![]() To add VHDL generics or Verilog compiler directives and parameters, carry out the following steps: In Lattice Diamond, set up your project, import your code, and synthesise it using either Lattice Synthesis Engine (LSE) or Synopsys Synplify Pro®. Setting Generics/Parameters in Lattice Diamond Lattice ispLever Classic uses Synopsys Synplify Pro® as its synthesis tool, so see the section below about Synopsys Synplify Pro®. Setting Generics/Parameters in Lattice ispLever Classic You can now set the generics - see the following screen shot: Now use the menu option Assignments > Settings. Load in your design, and analyze it by clicking the button Start Analysis and Synthesis. Setting Generics/Parameters in Altera Quartus II Note that because each tool has to analyze the code first to identify the generics, it is a good plan to put default values as shown above so that the code will definitely synthesize even without overriding the generic values. The rest of this page shows some examples. ![]() To go further than this, and override the generics from a synthesis tool, you'll have use tool specific features. If you do that, it makes sense to re-write the generic declaration so that each generic can be given a different default value, i.e: library IEEE One way round this is simply to give the generics default values - the synthesis tool will then use those defaults. This works fine for simulation, but of course if you try to synthesize the counter on its own, the synthesis tool does not know the value of the generics. Port map (Reset => Reset, Clock => Clock, Generic map (NBits => 8, MaxCount => 100) This can be simulated - the testbench wires up the ports and sets the generic as follows U1: entity work.Counter ![]() Here, the testbench wires up theentity declaration of a parameterised counter in VHDL: library IEEE Both these techniques allow parameterisable designs, that is designs that can be easily re-used in different situations. VHDL has the powerful feature of generics, while Verilog has the option of defining parameters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |