Lab: 6

Software control of custom IP hardware

The goal of this lab is to allow you to create a hardware and software system that can function as a function generator and oscilloscope.

C-level Functionality

This level of functionality will earn a 75% grade. The requirements: The user should be able to interact with the hardware on a serial interface running on the ARM-A9. This interface should allow the user to

B-level Functionality

This level of functionality will earn an 85% grade. The requirements are all the requirements of C-level functionality plus the following. The user should be able to interact with the hardware on a serial interface running on the ARM-A9. This interface should allow the user to

A-level Functionality

This level of functionality will earn an 95% grade. The requirements are all the requirements of B-level functionality (where they do not conflict), plus the following. The user should be able to interact with the hardware on a serial interface running on the ARM-A9. This interface should allow the user to

Bonus

Up to 5% of bonus points will be awarded for incorporating some hardware/software functionality not covered in the class. For example:

Flag register

I've provided some code for an interface mechanism that allows your custom IP to send status information to your ARM-A9. The reason that you may need this register is because, often times, the status bits that your IP sends are valid for a single clock cycle, but the software running on the ARM-A9 may not get around to checking that status bit for a while. When the ARM-A9 gets around to checking the status bit, it may be gone.

entity flagRegister is
	generic (N: integer := 8);
	port(	clk: in  STD_LOGIC;
		resetn : in  STD_LOGIC;
		set, clear: in std_logic_vector(N-1 downto 0);
		Q: out std_logic_vector(N-1 downto 0));
end flagRegister;
The flag register solves this problem using a "sticky" status bit. In other words your IP status bit connects to the set input of the flag register to set the Q bit output of the flag regster to logic 1. The Q output of the flag register is sent to ARM-A9 through one of the SLV_REGx memory mapped registers. Since the Q output is "sticky" it stays set until cleared. This way the ARM-A9 can take its time to read the status bit. When the ARM-A9 is done reading the "sticky status bit, it can clear this bit back to logic 0 by writing the flag register's clear input through one of the memory mapped SLV_REGy. The cycle is now ready to repeat. And yes, this is exactly the same process used on the PIC 18F26K22 status register - think the TMR0IOF bit of the TMR0CON register.