- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
ISim: specify bitvectors in Tcl console
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-11-2010 01:56 PM
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).
Re: ISim: specify bitvectors in Tcl console
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-11-2010 02:20 PM - edited 11-11-2010 02:23 PM
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).
Re: ISim: specify bitvectors in Tcl console
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-11-2010 02:29 PM
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
Re: ISim: specify bitvectors in Tcl console
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-11-2010 02:55 PM - edited 11-11-2010 03:02 PM
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).











