XST - configuration - VHDL

  • Thread starter Jaime Andrés Aranguren Cardona
  • Start date
J

Jaime Andrés Aranguren Cardona

Dear all,

In my current project I have an entity for which I which arhitecture
to use on a VHDL file where I instantiate the entity, like following
configuration code:

-- Embedded configuration
-- Select control architecture to use
for all : Ctrl2D use entity work.Ctrl2D(rtl_small);

Within the VHDL file where Ctrl2D is defined, I have different
configurations, namely rtl_tiny and rtl_small. Within each of those,
are processes which have variables whose length depend on some
constants (KA, KB), like:

process_out : process (in_a, in_b)
variable var : std_logic_vector (KA-KB-1 downto 0) := (others =>
'0');
begin

I should select which architecture to use in the configuration
(rtl_tiny or rtl_small) depending on a given a given set of values KA
and KB. For a set of values KA and KB that works fine with rtl_small
and having rtl_small selected in the configuration, XST, when parsing,
gives me warnign and error messages:

Entity <Ctrl2D> compiled.
WARNING:HDLParsers:3350 - "D:/Projects/Ctrl2D.vhd" Line 157. Null
range: -33 downto 0
ERROR:HDLParsers:804 - "D:/Projects/Ctrl2D.vhd" Line 214. Size of
concat operation is different than size of the target.
Entity <Ctrl2D> (Architecture <rtl_small>) compiled.

But those lines (157 and 214) are within the architecture rtl_tiny,
not rtl_small.

I was confident that by selecting the right architecture in the
configuration I was completely bypassing everything related to non-
desired architectures, but it seems like I was wrong.

How can I direct XST to ignore the code of the non-interesting
architectures, and parse and synthesize only the one that I selected
in the configuration?

Thanks a lot in advance,

JaaC
 
A

Andy

Dear all,

In my current project I have an entity for which I which arhitecture
to use on a VHDL file where I instantiate the entity, like following
configuration code:

-- Embedded configuration
-- Select control architecture to use
for all : Ctrl2D use entity work.Ctrl2D(rtl_small);

Within the VHDL file where Ctrl2D is defined, I have different
configurations, namely rtl_tiny and rtl_small. Within each of those,
are processes which have variables whose length depend on some
constants (KA, KB), like:

process_out : process (in_a, in_b)
    variable var : std_logic_vector (KA-KB-1 downto 0)  := (others =>
'0');
  begin

I should select which architecture to use in the configuration
(rtl_tiny or rtl_small) depending on a given a given set of values KA
and KB. For a set of values KA and KB that works fine with rtl_small
and having rtl_small selected in the configuration, XST, when parsing,
gives me warnign and error messages:

Entity <Ctrl2D> compiled.
WARNING:HDLParsers:3350 - "D:/Projects/Ctrl2D.vhd" Line 157. Null
range: -33 downto 0
ERROR:HDLParsers:804 - "D:/Projects/Ctrl2D.vhd" Line 214. Size of
concat operation is different than size of the target.
Entity <Ctrl2D> (Architecture <rtl_small>) compiled.

But those lines (157 and 214) are within the architecture rtl_tiny,
not rtl_small.

I was confident that by selecting the right architecture in the
configuration I was completely bypassing everything related to non-
desired architectures, but it seems like I was wrong.

How can I direct XST to ignore the code of the non-interesting
architectures, and parse and synthesize only the one that I selected
in the configuration?

Thanks a lot in advance,

JaaC

Unlike simulation tools, synthesis tools combine the analysis and
elaboration phases into one. This is probably leading to your problem.
Leaving something out in a configuration is not quite like
conditionally compiling it. Everything gets analyzed (if it is in a
file that is being analyzed), whether it is chosen at elaboration or
not. Some simulators have options for compiling (analyzing) only
certain types of units (packages, package bodies, entities,
architectures, etc.) and ignoring others in the same file. I have not
seen that in a synthesis tool.

Other than fixing the problem with the mismatched size (if even
possible), I would suggest moving the two architectures into separate
files, and only including the appropriate file in the project.

Andy
 
J

Jaime Andrés Aranguren Cardona

Unlike simulation tools, synthesis tools combine the analysis and
elaboration phases into one. This is probably leading to your problem.
Leaving something out in a configuration is not quite like
conditionally compiling it. Everything gets analyzed (if it is in a
file that is being analyzed), whether it is chosen at elaboration or
not. Some simulators have options for compiling (analyzing) only
certain types of units (packages, package bodies, entities,
architectures, etc.) and ignoring others in the same file. I have not
seen that in a synthesis tool.

Other than fixing the problem with the mismatched size (if even
possible), I would suggest moving the two architectures into separate
files, and only including the appropriate file in the project.

Andy

Hi Andy,

Thanks for your reply, I found the solution however: adding pragmas:

architecture struct of Stack2D is

signal dat_2ext : buf2dwrd;
signal rd_2ext : std_logic;
signal dat_2slv : buf2dwrd;
signal wr_2slv : std_logic;

-- pragma synthesis on
for all : Ctrl2D use entity work.Ctrl2D(rtl_small);
-- pragma synthesis off

begin

The commented pragmas did the job.

Regards.
 
J

Jaime Andrés Aranguren Cardona

Hi Andy,

Thanks for your reply, I found the solution however: adding pragmas:

architecture struct of Stack2D is

  signal dat_2ext : buf2dwrd;
  signal rd_2ext  : std_logic;
  signal dat_2slv : buf2dwrd;
  signal wr_2slv  : std_logic;

  -- pragma synthesis on
  for all : Ctrl2D use entity work.Ctrl2D(rtl_small);
  -- pragma synthesis off

begin

The commented pragmas did the job.

Regards.

Dear all,

By the way, is there a way to make a conditional selection of
architecture to use, something in the lines of:

for all : Ctrl2D if A = 0 use entity work.Ctrl2D(architecture_a) else
use entity work.Ctrl2D(architecture_b); ???

Or is there an alternative approach?

Thanks lot in advance.

JaaC
 
M

Mike Treseler

Maybe.
Were both architectures in the synthesis file list?
If so which one was first?

I use a similar trick to insert debug code into synthesis sources:

-- synthesis translate off
spy: process (strobe_s) is
begin -- process watch
if falling_edge(strobe_s) then
report("data = ", work.my_pkg.std2hexstr(my_ctr));
end if;
end process spy;
-- synthesis translate on

By the way, is there a way to make a conditional selection of
architecture to use, something in the lines of:

for all : Ctrl2D if A = 0 use entity work.Ctrl2D(architecture_a) else
use entity work.Ctrl2D(architecture_b); ???

Not that I know of for synthesis, where I must declare
one top entity and file list. There is no notion
of vhdl libraries or configurations.
> Or is there an alternative approach?

I could generate one direct instance or another
based on a packaged constant value, but I find this confusing.

If the architecture differences are much less the spare fpga resources,
I might combine both modes and select using a mode
register or a jumper.

-- Mike Treseler
 
A

Andy

Dear all,

By the way, is there a way to make a conditional selection of
architecture to use, something in the lines of:

for all : Ctrl2D if A = 0 use entity work.Ctrl2D(architecture_a)  else
use entity work.Ctrl2D(architecture_b);   ???

Or is there an alternative approach?

Thanks lot in advance.

JaaC- Hide quoted text -

- Show quoted text -

The only way to do that is with an if-generate on the instantiation,
not the configuration.

In fact, since the '93 standard, you can directly instantiate an
entity and its architecture:

if a = 0 generate
u1: entity work.entity_name(architecture_name)...
end generate;

if a /= 0 generate
u1: entity work.entity_name(alternative_architecture_name) ...
end generate;

You don't even need to mess with a configuration!

Andy
 
J

Jaime Andrés Aranguren Cardona

The only way to do that is with an if-generate on the instantiation,
not the configuration.

In fact, since the '93 standard, you can directly instantiate an
entity and its architecture:

if a = 0 generate
u1: entity work.entity_name(architecture_name)...
end generate;

if a /= 0 generate
u1: entity work.entity_name(alternative_architecture_name) ...
end generate;

You don't even need to mess with a configuration!

Andy- Zitierten Text ausblenden -

- Zitierten Text anzeigen -

Dear all,

Thanks for the feedback. Andy's suggestion seems to be very in the
direction I was heading for, thanks a lot.

Kindest regards,

JaaC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top