Forum Discussion
Help with VJTAG and TCL script
I must be doing something really stupid here.
The problem I have is that I seem to have a disagreement between instruction register values in TCL script and in Verilog.
In TCL:
set RESET_HI_CMD 11
set RESET_LO_CMD 12
..
device_virtual_ir_shift -instance_index 0 -ir_value $RESET_LO_CMD
setJTAGBypass
after 3000
device_virtual_ir_shift -instance_index 0 -ir_value $RESET_HI_CMD
setJTAGBypass
In Verilog:
localparam RESETHI = 4'b1011; // Definitely 11, same as TCL
localparam RESETLO = 4'b1100; // Definitely 12, same as TCL..
if( opco[3:0] == RESETLO)
begin
notReset <= 0;
oLED1 <= 0;
oLED8 <= ~ oLED8;
end
else
if( opco[3:0] == RESETHI)
begin
notReset <= 1;
oLED1 <= 1;
oLED7 <= ~ oLED7;
end
What I'm observing is a sequence of RESETHI-(3 seconds)-RESETLO on my device when it SHOULD be RESETLO-(3 seconds)-RESETHI
Any ideas please?
5 Replies
- YuanLi_S_Intel
Regular Contributor
Hi, could you check if the ir command is correct by using the show_equivalent_device_ir_dr_shift argument.
If it is correct, it could be your design issue.
- SparkyNZ
Contributor
@YuanLi_S_Intel is this what you would expect to see?
Info (262019): Equivalent device ir and dr shift commands
Info (262020): device_dr_shift -length 12 -dr_value 00B -value_in_hex
Info (262020): device_dr_shift -length 12 -dr_value 40C -value_in_hex(3 second delay)
Info (262019): Equivalent device ir and dr shift commands
Info (262020): device_dr_shift -length 12 -dr_value 00B -value_in_hex
Info (262020): device_dr_shift -length 12 -dr_value 40B -value_in_hexI'm assuming the 40C corresponds to my RESET_LO_CMD (12) and 40B corresponds to RESET_HI_CMD (11) ?
- SparkyNZ
Contributor
@YuanLi_S_Intel there must be something wrong with my design. I've been struggling with this for weeks now.
I expect to see LED8 toggle, followed by LED7 toggle (RESETLO, 3 seconds, RESETHI). But what I see is the opposite (LED7 toggle= RESETHI, 3 seconds, LED8 toggle=RESETLO)
Am I not using uir correctly?
The full project can be found here: https://github.com/SparkyNZ/FixReset
- YuanLi_S_Intel
Regular Contributor
I am glad it is solved now.
Meanwhile for the TCK frequency, it affects the speed of communication using JTAG. You may put higher frequency to increase the speed. However, too high will cause communication issue as well. You can try and find the optimum speed for your case.