VHDL CODE GENERATION |
||||||||||||||||||||||||||||||||||||
DECISIONS TAKEN IN GENERATING THE VHDL CODE The GCI Automation tool generates VHDL code for the data read in through the word document. Hence knowledge of VHDL is a pre-requisite in the formation of the tool. This forces the designer to consider what decisions are to be taken in the formation of the VHDL code right from the leaf level to the uppermost node. This step is meticulously followed since it facilitates efficient coding and further enhancements. This step enlists detailed information of the signals to be included in the entity, syntax and semantics of the language, generics involved, structure of the top-level multiplexers and also about the style of modeling to be used in particular design criteria. It also gives the coder an idea as to what statements are repetitive, where to assign specific access types and also as to what signals to concatenate in the generation of an output signal. The genesis of this VHDL entity is from the base level flip-flops being the utmost base level entities.
Decisions for the basic register entity: Signals that are to be serviced at this level are as follows:
Check 1: If the reg_reset_input signal is high then the reg_data_out signal will naturally be the concatenation of all the default values, present in the table. Secondly we have to check whether individual resets in each base level flip flop is high. If this regsel signal is high then data_out of that flip flop is the default value. All other flip-flops data_out is the value stored in it.
Check-2: It may so happen that a particular number of flip flop may be of UNUSED status. If this is the case then the data_out of that flip-flop will contain the default value already specified in the table for that register. Check-2 also becomes very important in the context that we dont have to instantiate components for the unused bits, as it would lead to unnecessary wastage of memory space and resources. Hence it becomes very necessary to know the unused or rather the used bits only. The starting bits and ending bits SBN and EBN respectively will be given by the structure so the bus width of each row in the table will be known. By scrutinizing the ACCESS type given by the structure we can conclude whether the bits are unused or not. If the ACCESS type doesnt match to pre-defined formats then (EBN SBN) number of bits will have default values at their respective data_out signals. Components for (total _no_of_bits unsued_bits resetted_bits) will have to be instantiated and the concatenation of the data_out for these bits is done to form the reg_data_out signal. To provide functionality to each bit in the table we are instantiating a component for each bit. This component is nothing but a simple flip-flop. MULTIPLEXER DESIGN FOR THE SAME REGISTER TYPEThis multiplexer is the next level of hierarchy after the basic register entity. The register multiplexers and the registers are then declared as components in the structural modeling for the bank entity Here is an algorithm to generate VHDL code for this multiplexer:
Registername_data_tx.
REGISTER BANK ENTITY
Eg: Here tx_intr is the interrupt bank, which contains individual registers and the multiplexer: entity txintr is port( rxclk : in std_logic; .. .. -- Rx Handshake Interface read_req_rx : in std_logic; . ); end txintr; architecture structure of txintr is component txintmux( the interfaces of this entity); component txintreg( interfaces of this entity);thus the bank will be created .The output of this bank structure will be muxed to the Tx-Multiplexer depending upon register enables of the address decoder. Pin description for the Tx-Multiplexer:
The multiplexing process begins by first selecting the bank on the basis of the select_bus signal. This method is one hot in the sense that whenever a particular register is selected that particular bit in the select_bus signal is high. Code snippet to conceptualize this step: when "000001" => txposreg_data_tx <= statusreg_data_rx; when "000010" => txposreg_data_tx <= configreg_data_rx; when "000100" => txposreg_data_tx <= holdreg_data_rx; when "001000" => txposreg_data_tx <= pmonreg_data_rx;
Once the bank is selected the output of the bank is put through as output of the multiplexer. In case the value of the select_bus signal is anything other than the specified values the value of the multiplexer o/p is set to be ground_data.
when others => txposreg_data_tx < = ground_data_tx; Decisions for the address decoder block: The address decoder block is an integral part of any complex design as it plays an important function of decoding the address generated by the user and accessing the specified register. In the given GCI we have five banks of registers (refer to the architecture of the GCI). Hence the number of banks is fixed but the number of registers in each bank is not fixed. The user has to specify the bank type. In this case we use three bits for assigning each bank a separate and unique identity. Algorithm for Address Decoder Algorithm for Address Decoder;
CODE TESTING AND RTL SYNTHESIS: Generic Controller Interface The following instructions are for simulating the Generic Controller Interface on the Modeltech V-System simulator version 4.4j. Other simulators or other versions of the V-System simulator may involve steps not listed below. Assumption : We assume that the product database has been unzipped into C:\mydir\GCI. If you have installed the product database into some other directory, replace its path in the place of "c:\mydir" in the instructions that follow. Note : V-System accepts file paths delimited by "/" or "\". Setup : 1. Select the Working Directory as C:\mydir\GCI\sim. This is essential as the Report file generated by the Test bench gets stored in the same working directory. 2. Confirm, or change to, these simulator settings: i) simulator resolution to ps. ii) "ignore warning" turned on. iii) set TabWidth = 4 Functional Simulation : The functional simulation can be carried out using following steps In compile options set "use explicit declarations only" RTL Compilation 1. Create a library called work in the working directory.This is done by executing the following command at the V-System command prompt. vlib work 2. Define a V-System environment variable projdir by using the following command set projdir C:/mydir/GCI 3. Execute a macro from C:\mydir\GCI\macro, which will compile both the CoreCell and the Test Bench. This is done by executing following command at the V-System command prompt. do $projdir/macro/makeall.do RTL Simulation 1. Copy the test scripts as txtest.cmd and rxtest.cmd to the current working directory. Make sure that the same functional scripts are run for rx and tx , at the same time, e.g. rxsonet.cmd and txsonet.cmd should be copied as rxtest.cmd and txtest.cmd vsim itop run 12100 us 2. Similarly copy rxsdh.cmd and txsdh.cmd as rxtest.cmd and txtest.cmd run 14 ms 3. Run other scripts in a similar manner with the time specified in the script files 4. Check the report file for errors. The simulator generates three test reports called 'mup.rep', 'rxerr.rep', 'txerr.rep' in the current directory. This file may be examined for errors. Presence of 'Test failure' in the report indicates failure at some point during the test. 'mup.rep' contains information about microprocessor transactions.
|