![]() |
|
|
|||||||
![]() |
VHDL - Showing value of loop iteration in assert statement |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hello all
I have this loop, but I cant work out to display the appropriate channel to the screen when it fails.. The below example prints out the sentence as you see if (of course), but I want the value of J. I've tried a few things, similar to when you write values to a file, but havent been able to work it out Thanks Andrew for J in 0 to 3 loop if (exp_analog_channel(J) /= tb_channel_out(J)) then assert false report "Channel J failed " severity note; -- how do I get 'J' to show value?? end if; end loop; dwerdna |
|
|
|
|
#2 |
|
Posts: n/a
|
All strings can be displayed in the report message
report "Channel"&conv_string(J)&"failed" severity note; arul_enggus@yahoo.com |
|
|
|
#3 |
|
Posts: n/a
|
On 29 Mar 2005 22:45:01 -0800, wrote:
>All strings can be displayed in the report message > >report "Channel"&conv_string(J)&"failed" >severity note; conv_string is not standard; it's nicer to use the built-in function 'IMAGE that comes with every scalar data type: report "channel " & integer'IMAGE(J) & " failed" -- Jonathan Bromley, Consultant DOULOS - Developing Design Know-how VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK Tel: +44 (0)1425 471223 mail: Fax: +44 (0)1425 471573 Web: http://www.doulos.com The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated. Jonathan Bromley |
|
|
|
#4 |
|
Posts: n/a
|
Thanks! I'll give it a go
Andrew dwerdna |
|
|
|
#5 |
|
Posts: n/a
|
report "Channel" & integer'image(J) & failed";
"dwerdna" <> wrote in message news: ps.com... > Hello all > > I have this loop, but I cant work out to display the appropriate > channel to the screen when it fails.. > > The below example prints out the sentence as you see if (of course), > but I want the value of J. I've tried a few things, similar to when > you write values to a file, but havent been able to work it out > > Thanks > > Andrew > > for J in 0 to 3 loop > if (exp_analog_channel(J) /= tb_channel_out(J)) then > assert false > report "Channel J failed " severity note; -- how do I get 'J' to > show value?? > end if; > end loop; > Jerry |
|
|
|
#6 |
|
Posts: n/a
|
Just to add to it: Just in case your data type is different from a
scalar type, then 'image is not defined in VHDL-93. Ben has developed a IMAGE pkg that can handle most of the cases, take a look at http://www.vhdlcohen.com --> Models HTH Aji http://www.noveldv.com Ajeetha |
|