Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Expert Contributor
awillen
Posts: 690
Registered: ‎11-29-2007
0

ISim: specify bitvectors in Tcl console

Is there a concise way to enter a bitvector of a given length in the ISim Tcl console? For example, I have a 128 bit signal "foo" and want to assign the value 0 to it:

put foo 0

doesn't work, because "0" (1 bit) doesn't match the size of the signal (128 bit). In a perfect world, I could do this:

put foo 128'b0

but that doesn't work either. Obviously, writing 128 zeroes is out of the question, so does there exist a simple solution, or do I have to write a function which takes a value and a length myself?



Signature:
1. Google your question before asking it.
2. If Google doesn't find a solution, post your question in a detailed, comprehensive, and clear way.
3. If someone answers your question, mark the post with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (the star on the left).
Expert Contributor
awillen
Posts: 690
Registered: ‎11-29-2007
0

Re: ISim: specify bitvectors in Tcl console

[ Edited ]

Nevermind, I found a solution:

put foo 0 -radix hex

(or oct – bin and dec don't work)



Signature:
1. Google your question before asking it.
2. If Google doesn't find a solution, post your question in a detailed, comprehensive, and clear way.
3. If someone answers your question, mark the post with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (the star on the left).
Expert Contributor
gszakacs
Posts: 5,265
Registered: ‎08-14-2007
0

Re: ISim: specify bitvectors in Tcl console

put foo 0

 

works for me.  Are you using Verilog?

 

The strange thing I see (and maybe I don't understand how "put" really works) is that

whatever I put in foo shows up in the object window, but not in the wave window.  But

I don't get a size mismatch problem and whatever I type gets zero-extended to fill

the entire 128 bits.  There is mention in the ISIM manual that the "put" command uses

the radix.  I have my default radix set to hexadecimal.  Don't know if that has anything

to do with it.

 

Regards,

Gabor

-- Gabor
Expert Contributor
awillen
Posts: 690
Registered: ‎11-29-2007
0

Re: ISim: specify bitvectors in Tcl console

[ Edited ]

Yes, I'm using Verilog. My default radix setting was at binary; I've set it to hexadecimal now and the put command works without the -radix option. Thanks for the hint!

 

Edit: by the way, the value in the wave window is updated as soon as you select the signal.

 

 

Adrian



Signature:
1. Google your question before asking it.
2. If Google doesn't find a solution, post your question in a detailed, comprehensive, and clear way.
3. If someone answers your question, mark the post with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (the star on the left).