Hi Josy,
Please take a look at the attached zip file. There are three designs in there. I'll just copy the readme.txt inline as it describes the files;
--- Quote Start ---
VHDL generics and configurations examples
-----------------------------------------
7/1/2011 D. W. Hawkins (
dwh@ovro.caltech.edu)
These design examples target the BeMicro-SDK stick. I downloaded
each synthesized design and checked they worked (each design uses
a different blink rate to distinguish them in hardware).
In all cases the design implements a simple blinking LEDs example.
However, each design implements hierarchy in a different manner.
1. example1/
This is the simplest version of the design. The top-level file
bemicro_sdk takes generics that specify the LED blink parameters.
The values of the generics are specified by the synthesis script.
The blink_leds counter is implemented using generic VHDL.
The LED blink rate is set to 1.0s
2. example2/
This design adds additional generics to the top-level design that
are passed down to a counter component in the blink_leds component,
The generics can be set to select a "GENERIC" implementation of a
counter (as used in example1), or an "ALTERA" specific implementation.
The "ALTERA" implementation can be "GENERIC" which instantiates
code that corresponds to Altera's recommended HDL coding style for
correct inference of logic (in this case, its no different than
example1), or "DEFAULT" or "LPM" which implements an LPM counter.
The LED blink rate is set to 0.5s
3. example3/
Rather than using generics to specify the counter, this design uses
VHDL configurations.
The counter used in the blink_leds component implemented using
a component interface description called up_counter. There is
no corresponding entity/architecture pair for this component.
A configuration file is then used to specify the mapping from
up_counter to either a generic counter or an Altera specific
counter.
The LED blink rate is set to 0.25s
-------
To synthesize the designs;
1. Start Quartus (I tested this on 10.1)
2. Open the Tcl console via View->Utility Windows->Tcl Console
3. Change directory to the example, eg.
tcl> cd {
C:\temp\vhdl_configurations\example1} The curly braces pass the directory as a 'list' to Tcl and
it correctly interprets the path under windows. I don't think
they're required under Linux.
4. Run the synthesis script via:
tcl> source scripts/synth.tcl
5. Once the design is synthesized, you can rebuild via the 'play'
button in the Quartus GUI, or you can re-source the script.
If you edit the designs and get synthesis error, then the Tcl
path might be set to the work folder, so up-arrow to the cd
command, and then re-source the script.
6. The synthesis scripts play nicely in that you can switch between
designs without having to close them in Quartus, eg.
tcl> cd {
C:\temp\vhdl_configurations\example1} tcl> source scripts/synth.tcl
tcl> cd {
C:\temp\vhdl_configurations\example2} tcl> source scripts/synth.tcl
tcl> cd {
C:\temp\vhdl_configurations\example3} tcl> source scripts/synth.tcl
and then back to example 1
tcl> cd {
C:\temp\vhdl_configurations\example1} tcl> source scripts/synth.tcl
will synthesize each design correctly.
--- Quote End ---
Take a look at the scripts/synth.tcl scripts. They're the examples of synthesis scripts I was going to send.
However, what I have also done with these examples is show you how you can abstract your FIFO component so that you could instantiate a specific FIFO implementation. Example 2 shows how you can customize the component using generics, while example 3 shows customization using a configuration.
Enjoy!
Cheers,
Dave