P
Paddy3118
Guest
http://paddy3118.blogspot.com/2008/03/writing-vcd-to-toggle-count-generator.html
- Paddy.
- Paddy.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
http://paddy3118.blogspot.com/2008/03/writing-vcd-to-toggle-count-generator.html
- Paddy.
In my application that is not required, so has not been added. I amPaddy3118 wrote:
Do you differentiate between a glitch and data that is present for a
clock cycle? Andy
http://paddy3118.blogspot.com/2008/03/writing-vcd-to-toggle-count-gen...
- Paddy.
Mark,Hi Paddy,
I recently trialled your VCD toggle count code and came across a
problem with it. I use ModelSim so the VCD output may be a little
different to what your simulator produces. Anyway the problem
occurred on $var lines, the example I have has the following syntax:
$var reg 1 " clk $end
$var reg 8 # data [7:0] $end
The first line is parsed okay but the second one caused problems. I
changed the vcd_var function to take into account the extra bus
information. I have included the changes below, you may be able to
think of a better way as my Python knowledge is fairly limited.
def vcd_var(tokeniser, keyword):
var_options = tuple(takewhile(lambda x: x != "$end", tokeniser))
if len(var_options) == 4 :
var_type, size, identifier_code, reference = var_options;
else :
var_type, size, identifier_code, reference, bus_size =
var_options;
reference = vcd.scope + [('var', reference)]
vcd.idcode2references[identifier_code].append( (var_type, size,
reference))
vcd.reference2idcode[tuple(reference)] = identifier_code
vcd.id2stats[identifier_code] = IdStats(size)
One other problem I noticed with your code is when reporting which
signals in a bus where toggling it reversed the bit order.
I have also expanded your code to get a transition count of all the
signals in a simulation as I wanted to use this figure to generate a
guesstimate of the power required. If you would like this code let me
know and I will email it to you.
You also mentioned you made some updates to the code, have you posted
these onto the web anywhere?
Cheers,
Mark
ps. If you see a similar email to this one, its because I thought the
original post did not work.