-
Notifications
You must be signed in to change notification settings - Fork 2
Create a Hardware Component
This tutorial is based on the template for Hardware Thread sound components which you can find here.
All your component needs is one (or more) output and one enable port. Additionally one or more input ports are possible.
For the following we assume, that we already have an inplemented component (BASIC_COMPONENT) with the following ports.
clk : in std_logic;rst : in std_logic;ce : in std_logic;-
input : in signed(31 downto 0);for incoming samples -
param : in signed(31 downto 0);as another random parameter -
output : in signed(31 downto 0);for modified samples
Each HWT is attached to a FIFO in order to receive data from the Synthesizer. In order to use them for calculations, the HWT copies this data to its local RAM, where the samples, parameters etc are read as required.
The HWT's processing takes place in the state machine in the process HWT_CTRL_FSM_PROC. Basically, the FSM consists of the following states:
-
STATE_IDLE, where the HWT waits for the Synthesizer to start the HWT -
STATE_REFRESH_HWT_ARGS, where the HWT loads the Synthesizer's data (parameters etc) to local signals -
STATE_READ, where the HWT loads the incoming samples to local RAM -
STATE_PROCESS, where the basic component is enabled to create/modify samples -
STATE_WRITE_MEM, where the created/modified samples are written back to the FIFO -
STATE_NOTIFY, where the Synthesizer is informed, that the HWT is finished -
STATE_EXIT, where the HWT is terminated
You can see the basic component's embedment here.
-
STATE_IDLE: Wait for a Messagebox from the Synthesizer. -
STATE_REFRESH_HWT_ARGS: The HWT's arguments/parameters are refreshed. In this example, they arguments containsourceaddress, where samples are read,destaddress, where samples are written andparam, which is a random argument. These arguments are stored in the signalshwtio.argv(0),hwtio.argv(1)andhwtio.argv(3). -
STATE_READ: According to the source address inhwtio.argv(0)64 samples are read into local RAM -
STATE_PROCESS: The signalo_RAMAddr_hwtis the address to the current sample in the local RAM, which is increased after enabling the basic component. This address is pointing to a sample stored in the signali_RAMData_hwt. In order to write a sample, the signalo_RAMData_hwtneeds to be assigned. -
STATE_WRITE_MEM: Write local RAM back to FIFO -
STATE_NOTIFY: Notify Synthesizer
-
clkandrstare wired to the Clock and Reset signal from the HWT -
ceis wired to a local signal, also calledce -
inputis wired toi_RAMData_hwt, which depicts the current value from the local RAM, on whicho_RAMAddr_hwtpoints -
paramis wired tohwtio.argv(2) -
outputis a driver for the signalo_RAMData_hwt. This stores the modified sample to the local RAM.
In order to use your HWT, you need to create a directory here, which contains the following to directories:
-
data- adjust MPD, PAO and TCL files and store them here -
hdl/vhdl- your VHDL files (basic component, HWT) are stored here