Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Custom Synthesis Error Generation

Reply
Thread Tools

Custom Synthesis Error Generation

 
 
French
Guest
Posts: n/a
 
      05-06-2009
Hi,

Does anybody know how I can generate custom error during synthesis
(and not during runtime) inside my vhdl code.

For example, I have defined an entity feature two generics and I would
like to generate a specific error during the synthesis of the current
block is a forbidden combination of my generic parameters occurs.

i.e:

entity test is
generic
( param1 : integer := 23;
param2 : integer := 24); -- always works but when both param1 and
param2 are equal to 32
....

it would be very helpfull to detect missuses of some component defined
in libraries that would not be explicitely reported otherwhise.

I have found some ways to do it during simulation using assert
commands with severity parameters but, as assert must be used in a
sequential process it cannot work during synthesis
 
Reply With Quote
 
 
 
 
Sean Durkin
Guest
Posts: n/a
 
      05-06-2009
French wrote:
> I have found some ways to do it during simulation using assert
> commands with severity parameters but, as assert must be used in a
> sequential process it cannot work during synthesis


Many synthesis tools do in fact evaluate assertions. All the ones I've
seen at least issue a warning, some even halt synthesis when the
severity level is "error" or "failure".

I know it works with XST, and for Mentor's Precision there's a
command-line switch that enables this behaviour:

setup_design -var "rtl_extra_options=-allow_assert_error"

Not sure how it is with Quartus or Synplify.

In some cases there's the possibility to do something similar with range
constraints. Example: You have a generic that should only have valid
values from 1 to 12. Now you could create an integer subtype with range
1 to 12 and make the generic of that type. That way, when someone sets
the generic to an invalid value, the synthesis tool will halt with an
"out of range" error. This definitely should work with any synthesis tool.

But this only works in simple cases, obviously, and you can't customize
the error message that is generated.

HTH,
Sean

--
Replace "MONTH" with the three-letter abbreviation of the current month
(simple, eh?).
 
Reply With Quote
 
 
 
 
Matthieu
Guest
Posts: n/a
 
      05-06-2009
On May 6, 7:55*am, French <mace.franc...@gmail.com> wrote:
> Hi,
>
> Does anybody know how I can generate custom error during synthesis
> (and not during runtime) inside my vhdl code.
>
> For example, I have defined an entity feature two generics and I would
> like to generate a specific error during the synthesis of the current
> block is a forbidden combination of my generic parameters occurs.
>



Hey French


You may want to take a closer look at the "assert" statement: The
assert statement isn't required to be called within a sequential
process, as a matter of fact, it can also be used as a concurrent
statement as well.

Usually I would place these assert statements just before the end of
the architecture implementation. The following code snippet is
correctly interpreted by the Xilinx design flow and Modelsim.
-------
(...)
ARG_CHECK: assert (MUST_ALWAYS_BE_TRUE_GENERIC = true)
report "Invalid argument: MUST_ALWAYS_BE_TRUE_GENERIC boolean is
not tru.e"
severity failure;
end architecture RTL;
-------

Hope this helps.
 
Reply With Quote
 
Tricky
Guest
Posts: n/a
 
      05-06-2009
There has been some discussion about this previously:

http://groups.google.co.uk/group/com...s+assert&fwc=1

Overall conclusions:

Synplify and Synopsis DC = Completly ignored it
Precision = Threw a warning and carried on even for ERROR and FAILURE
states
XST and Quartus = Handled them correctly.

Hope this helps.
 
Reply With Quote
 
French
Guest
Posts: n/a
 
      05-06-2009
Thanks to all of you for the very quick answer,

it made my day.
 
Reply With Quote
 
smurfjavel smurfjavel is offline
Junior Member
Join Date: Oct 2009
Posts: 1
 
      10-08-2009
At least Synplify Pro sets a Synthesis error if you generate a process with a wait statement.

I tried this which works both for synthesis and for simulation, might be helpful if you would like to force synthesis error depending on a specific combination of generics. In the case below the generic type is string (with no range).

-- Check generic
b_generic_check: if g_mode /= "non-dest" and
g_mode /= "dest" and
g_mode /= "off" generate
process
begin
assert false
report "Generic is set to an invalid value."
severity failure;
wait for 1 us;
wait;
end process;
end generate b_generic_check;

Synplify pro gave the error
@E: CD443 ... Wait with no wakeup condition is not supported except at end of process
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ModelSim Error : "Fatal error in Process determine_phase_shift" during post synthesis of Xilinx vhd fpgaengineer VHDL 7 03-12-2007 07:24 PM
synthesis error with DC rajan VHDL 3 09-01-2004 09:41 PM
HTML Generation (Next Generation CGI) John W. Long Ruby 4 11-24-2003 04:24 AM
SOS! newbie question about synthesizable VHDL : synthesis run successfully but post-synthesis failed... walala VHDL 4 09-09-2003 08:41 AM
what are the possible reasons that successful pre-synthesis simulation + successful synthesis = failed post-synthes walala VHDL 4 09-08-2003 01:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57