New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vcd input file #267
Comments
My bad, really. I did write teh VCD input for a purpose, then forgot to properly document it... So the syntax is not PORTB, it's the actual ioctl() call made to simavr internally, plus an index so for example for my PORTH5 is written "iogH_5" In you case since you want to set all pins, use iogB_8 ( 8 is the index in https://github.com/buserror/simavr/blob/master/simavr/sim/avr_ioport.h for IOPORT_IRQ_PIN_ALL). Please confirm it works for you. I have a plan to change the 'names' (that iogB_8) to use the official IRQ names at some point, as it would definitely make things clearer... |
sorry does not seem to work. I disabled all output for PORTB in the source but see various numbers in r24 (PORTB,0x18, which should be PORTB) popping up. The r22(PINB,0x16) jumps from 0x0 to 0x1c and stays at that value. $timescale 1000 ns $end |
Hello, for single input, I can confirm it works for me. I uploaded a complete example here: Multiple inputs did not work, as soon as I added The vcd output showed no changes on PINC and the output on PORTB did not change either as I would have expected. I could need some help here to get the simulator ready to read multiple signals. |
I'll have a look, I think VCD input is way cool for offline development |
@buserror , I was going to open a similar issue, but then I stumbled upon this one. I am writing some code targeting an attiny85, and I am trying to feed the following file to
Just to rule out dumb errors on my part, this is what I expect to happen:
The traces look fine in
...it just exits immediately. If I add Any idea what's going on here? |
(I've worked around this by using |
Yeah, this is the exact behavior I'm getting too... not sure what the deal is. I'll try debugging simavr and see if I can find anything. |
Oh. Well it's not very documented, but at sim_vcd_file.c:208, the simulator will just stop when it reaches the end of the input VCD file. If you put an event with a very large time at the end of your VCD file, it will run as you might expect. Still, this isn't obvious, and should really be an option. |
it looks like that simavr does not recognize/accept a vcd input file OR the layout/structure of the vcd input file is not well documented. I try to stimulate PB2 as input. GTKWAVE shows that the vcd file seems to be correct. avr-gdb shows that soemthing is happening on the PORTB but the overall timing is not clear.
simavr command:
simavr --freq 8000000 --mcu attiny45 --gdb --input test
Attached is a TGZ file (github does not accept this format, rename to *.tgz):
attiny45_motor.gz
.vcd attiny45_motor_001.elf
Head of vcd input file:
$timescale 1us $end
$scope module logic $end
$var wire 6 % PORTB $end
$upscope $end
$enddefinitions $end
$dumpvars
bxxxxxxx %
$end
#1000
b000100 %
#1097
b000000 %
#1194
b000100 %
....
The text was updated successfully, but these errors were encountered: