VHDL Configurations Tutorial
VHDL Configurations Tutorial
VHDL Configurations Tutorial
Table Of Contents
VHDL Configurations Tutorial.......................................................................................................... 1
Introduction .................................................................................................................................. 1
Loading sample project................................................................................................................ 1
Changing implementation of the BCD counter ............................................................................ 5
Adding a new architecture to the design...................................................................................... 8
Creating a new configuration ..................................................................................................... 11
Changing implementation by using symbol properties .............................................................. 17
configuration
testbench_cnt_bcd_conf
of
stimulusfromfile
for UUT : freq_top
use entity work.freq_top (freq_top);
for freq_top
for U1 : cnt_bcd
use entity work.cnt_bcd (cnt_bcd);
testbench
is
for
(hex2led);
(hex2led);
(hex2led);
(hex2led);
(control_arch);
NOTE: For more information on Graphical Processes, refer to the Graphical Process/Always
Blocks topic in the On-line Documentation (Active-HDL Help - Active-HDL Tools - Block
Diagram Editor - Block Diagram Items) or type in Graphical Process/Always Blocks in the Type
in the keyword to find field of the Index tab.
The following steps will explain how to change the implementation of the BCD counter from
CNT_BCD.bde to CNT_BCD2.bde.
Figure 9. By default, the Design Browser displays only the selected top-level unit and declared
packages.
The Show/Hide window presented in Figure 10 allows users to change the settings of the
displayed structure. The following options are available:
Figure 11. The structure of the freq_meter sample design after the selection of the Show all
option.
This setting additionally allows you to observe the changes made in the design's structure and
graphically present the differences between the default bindings resulting from the current
working library and configurations specified for the top-level unit. To see an example of such a
difference, let us look at the cnt_bcd (cnt_bcd2) component displayed in Figure 11 and /UUT/U1
instance from Figure12. Note that this component has two different implementations since the
binding for cnt_bcd (cnt_bcd2) results from the change discussed below and cnt_bcd
(cnt_bcd) comes from the testbench_cnt_bcd_conf design configuration stored in the
testbench_cnt_bcd_conf.vhd file.
8. Expand the structure of selected top-level and right-click the instance U1 (U1:
cnt_bcd(cnt_bcd)).
9. Choose the Select Architecture/Configuration option from the context menu as it is shown in
Figure 12.
Figure
12.
The
context
menu
of
the
to make changes in the configuration of their projects.
Structure
tab
allows
designers
10. In the Select Architecture/Configuration dialog, select the cnt_bcd2 architecture and then
click OK. Note the change that takes place in the design configuration; the Console window
displays the following message:
# Design: The 'testbench_cnt_bcd_conf' configuration from
.\src\testbench_cnt_bcd_conf.vhd has been changed and should be
recompiled.
Figure
15.
After
the
configuration
the configuration file needs to be re-compiled.
has
been
updated,
12. Two general changes have been made in the updated configuration file (Figure 16):
Figure
17.
The
Add
available in the pop-up menu of the Files tab.
New
Architecture
option
is
14. In the Add New Architecture window, enter the name of a new architecture, choose the type
of source file for a new implementation, and specify its location. Next, press OK.
The next steps will show how to modify the original HEX2LED converter for this tutorial's
purposes.
16. Load the hex2led.vhd file and select the part of the code shown in Figure 20.
when
when
when
when
when
when
when
when
when
when
when
when
when
"0100",
"0101",
"0110",
"0111",
"1000",
"1001",
"1010",
"1011",
"1100",
"1101",
"1110",
"1111",
others;
--4
--5
--6
--7
--8
--9
--A
--B
--C
--D
--E
--F
--0
library IEEE;
use ieee.std_logic_1164.all;
--}} End of automatically maintained section
architecture hex2led10 of hex2led is
begin
-- enter your statements here -with HEX select
LED <= "1000000" when "0000",
"1111001" when "0001",
"0100100" when "0010",
"0110000" when "0011",
"0011001" when "0100",
"0010010" when "0101",
"0000010" when "0110",
"1011000" when "0111",
"0000000" when "1000",
"0010000" when "1001",
"0000110" when others;
end architecture hex2led10;
-- 0
--1
--2
--3
--4
--5
--6
-- 7
--8
--9
-- E (Error)
10
Figure
23.
The
instances U2-U5.
Hierarchy
Viewer
presents
different
implementations
of
11
unit,
right-click
it
21. Enter the name of the configuration for the freq_top unit and close the window by clicking
OK.
12
freq_top_conf
freq_top(freq_top)
22. Let us see the contents of the newly created configuration file and load it into the HDL Editor
window.
Figure 27. The freq_top_conf.vhd file has been added to the design.
The contents of the newly created configuration file is shown in Figure 28.
In the next step, we will modify the configuration of freq_top by changing the
implementation of two instantiated components: U3 and U5.
component
and
choose
the
Select
13
14
with
changes
26. Compile the freq_top_conf.vhd configuration file into the current working library.
In the following steps, we will learn how to manage configurations and see how the
Hierarchy Viewer displays units configurations of which have already been specified. Let us
note a couple of important facts here. Up to now we:
1.
Changed
the
default
testbench_cnt_bcd_conf.vhd file.
and
pre-defined
configuration
stored
in
the
2. This configuration has been modified in step 9 and is shown in Figure 12.
3. Created a new additional architecture for the HEX2LED component in step 13.
4. Created a new configuration for freq_top (freq_top_conf) in the Creating a New
Configuration section - step 20.
5. Changed this configuration by specifying the hex2led architecture (instead of hex2led10)
for the components U3 and U5 in step 23.
We will now change the configuration of the UUT : freq_top(freq_top) unit instantiated in
testbench (stimulusfromfile).
27. Right-click the UUT : freq_top(freq_top) unit
Architecture/Configuration option as it is shown in Figure 32.
and
choose
the
Select
15
Figure
34.
The
the Structure tab.
change
in
the
project
configuration
is
displayed
in
30. Open the testbench_cnt_bcd_conf.vhd configuration file and compare its contents with the
code presented in Figure 4. The modified configuration for testbench(stimulusfromfile) now
points to another configuration that stores information on how entities of appropriate components
are bound to their corresponding architectures.
16
Figure
37.
The
Hierarchy
Viewer
of units other than simulation top-level.
also
displays
project
configurations
After you have selected another implementation/configuration (not the one distinguished as
Simulation Top-Level), the Hierarchy Viewer restores the information on different bindings,
which allows you to, e.g. find and/or compare differences among several configurations of the
design.
17
NOTE: To modify a configuration of the project by using this method, a new implementation must
be compiled to the current working library first. This version of Active-HDL does not support
architectures coming from a library other than the current working one.
33. To change the implementation for a selected instance, right-click a component in the Block
Diagram Editor window (freq_top.bde) and select the Properties option. Let us change the
implementation of U5.
18
implementation
(now,
its
entity
is
35. Compile the modified configuration (freq_top_conf.vhd) to update the design library.
19