Comments (7)
Hi,
Thanks for the issue ^^
First time i hear of something like it + the jtag stuff didn't changed since a quite long time, so it may be a yosys bug ?
Would have to check the netlist i guess.
Are tap_fsm_state still in the netlist after yosys ? (without the added = 0) ?
from vexriscv.
It seems like when an initial value is provided the register isn't considered for one-hot translation by yosys step FSM_EXTRACT
Not marking orbtrace_mini.VexRiscv.debugTransportModuleJtagTap_1.tap_fsm_state as FSM state register:
Register has an initialization value.
This can also be achieved with
(* fsm_encoding = "none" *) reg [3:0] tap_fsm_state;
Curiously if I add the reset state and don't just rely on the default
clause for it in the tap_state case statement:
JtagState_RESET : begin
_zz_tap_fsm_stateNext_16 = _zz_tap_fsm_stateNext;
end
Yosys report this in the log. The resulting bitstream works on the FPGA.
Not marking orbtrace_mini.VexRiscv.debugTransportModuleJtagTap_1.tap_fsm_state as FSM state register:
Circuit seems to be self-resetting.
Given that the addition of the JtagState_RESET state to the case shouldn't actually change anything logic wise I'm pretty sure the absence of it might be causing this issue. This is probably also tied into the fact that all 16 states are legal, and the TAP doesn't require a reset signal, which might make it un-suitable for this FSM extraction in yosys.
from vexriscv.
gg for the debug ^^
So, changing :
val stateNext = JtagState()
val state = RegNext(stateNext) randBoot()
stateNext := state.mux(
default -> (jtag.tms ? RESET | IDLE), //RESET
IDLE -> (jtag.tms ? DR_SELECT | IDLE),
IR_SELECT -> (jtag.tms ? RESET | IR_CAPTURE),
IR_CAPTURE -> (jtag.tms ? IR_EXIT1 | IR_SHIFT),
IR_SHIFT -> (jtag.tms ? IR_EXIT1 | IR_SHIFT),
IR_EXIT1 -> (jtag.tms ? IR_UPDATE | IR_PAUSE),
IR_PAUSE -> (jtag.tms ? IR_EXIT2 | IR_PAUSE),
IR_EXIT2 -> (jtag.tms ? IR_UPDATE | IR_SHIFT),
IR_UPDATE -> (jtag.tms ? DR_SELECT | IDLE),
DR_SELECT -> (jtag.tms ? IR_SELECT | DR_CAPTURE),
DR_CAPTURE -> (jtag.tms ? DR_EXIT1 | DR_SHIFT),
DR_SHIFT -> (jtag.tms ? DR_EXIT1 | DR_SHIFT),
DR_EXIT1 -> (jtag.tms ? DR_UPDATE | DR_PAUSE),
DR_PAUSE -> (jtag.tms ? DR_EXIT2 | DR_PAUSE),
DR_EXIT2 -> (jtag.tms ? DR_UPDATE | DR_SHIFT),
DR_UPDATE -> (jtag.tms ? DR_SELECT | IDLE)
)
into :
val stateNext = JtagState()
val state = RegNext(stateNext) randBoot()
stateNext := state.mux(
default -> (jtag.tms ? RESET | IDLE), //RESET
RESET -> (jtag.tms ? RESET | IDLE), // <---------------------------- adding this line
IDLE -> (jtag.tms ? DR_SELECT | IDLE),
IR_SELECT -> (jtag.tms ? RESET | IR_CAPTURE),
IR_CAPTURE -> (jtag.tms ? IR_EXIT1 | IR_SHIFT),
IR_SHIFT -> (jtag.tms ? IR_EXIT1 | IR_SHIFT),
IR_EXIT1 -> (jtag.tms ? IR_UPDATE | IR_PAUSE),
IR_PAUSE -> (jtag.tms ? IR_EXIT2 | IR_PAUSE),
IR_EXIT2 -> (jtag.tms ? IR_UPDATE | IR_SHIFT),
IR_UPDATE -> (jtag.tms ? DR_SELECT | IDLE),
DR_SELECT -> (jtag.tms ? IR_SELECT | DR_CAPTURE),
DR_CAPTURE -> (jtag.tms ? DR_EXIT1 | DR_SHIFT),
DR_SHIFT -> (jtag.tms ? DR_EXIT1 | DR_SHIFT),
DR_EXIT1 -> (jtag.tms ? DR_UPDATE | DR_PAUSE),
DR_PAUSE -> (jtag.tms ? DR_EXIT2 | DR_PAUSE),
DR_EXIT2 -> (jtag.tms ? DR_UPDATE | DR_SHIFT),
DR_UPDATE -> (jtag.tms ? DR_SELECT | IDLE)
)
would fix it ?
from vexriscv.
(conceptualy, because SpinalHDL will complain that :
UNREACHABLE DEFAULT STATEMENT on
spinal.lib.com.jtag.JtagFsm.(JtagTap.scala:67)
from vexriscv.
val stateNext = JtagState()
val state = RegNext(stateNext) randBoot()
switch(state, coverUnreachable = true){
default(stateNext := jtag.tms ? RESET | IDLE)
def add(k : JtagState.E, t : JtagState.E, f : JtagState.E) = is(k)(stateNext := jtag.tms.mux(t, f))
add(RESET , RESET , IDLE)
add(IDLE , DR_SELECT, IDLE)
add(IR_SELECT , RESET , IR_CAPTURE)
add(IR_CAPTURE, IR_EXIT1 , IR_SHIFT)
add(IR_SHIFT , IR_EXIT1 , IR_SHIFT)
add(IR_EXIT1 , IR_UPDATE, IR_PAUSE)
add(IR_PAUSE , IR_EXIT2 , IR_PAUSE)
add(IR_EXIT2 , IR_UPDATE, IR_SHIFT)
add(IR_UPDATE , DR_SELECT, IDLE)
add(DR_SELECT , IR_SELECT, DR_CAPTURE)
add(DR_CAPTURE, DR_EXIT1 , DR_SHIFT)
add(DR_SHIFT , DR_EXIT1 , DR_SHIFT)
add(DR_EXIT1 , DR_UPDATE, DR_PAUSE)
add(DR_PAUSE , DR_EXIT2 , DR_PAUSE)
add(DR_EXIT2 , DR_UPDATE, DR_SHIFT)
add(DR_UPDATE , DR_SELECT, IDLE)
}
Would fix it.
So, that would be good for you ?
that would only change the generated verilog by adding the :
JtagState_RESET : begin
_zz_tap_fsm_stateNext_16 = _zz_tap_fsm_stateNext;
end
from vexriscv.
Thanks for the fix on the Scala side. Yes, atleast from my editing of the verilog with exactly that line seems to fix the issue encountered by Yosys.
I'd be inclined to remove the default case if it's guaranteed that state/StateNext are 4 bits in size, since the default will never be reached as the case statements cover all possible states. But I'm not too familiar with SpinalHDL, so I'll defer that to you.
from vexriscv.
Fixed with SpinalHDL/SpinalHDL@2c5e826
It keep the default case empty and add the reset case.
Thanks for the issue ^^
from vexriscv.
Related Issues (20)
- FPU plugin to GenFull.scala HOT 3
- EU Funding HOT 3
- Compile C code and run bare metal cycle accurate simulation HOT 3
- Debug instructions executed twice HOT 5
- Exit cycle accurate simulation HOT 1
- Problems with adding FPU in Briey HOT 5
- Problem about how to compile the software that can be used in Vexriscv with FPU HOT 10
- How to use printf function? HOT 10
- About the Csr registers in Vexriscv HOT 2
- How to only modify certain one reset kind of specific Reg in vex core. HOT 1
- How to only modify certain one reset kind of specific Reg in vex core.
- AxiCrossBar with Standard Axi4 Interface in Briey HOT 15
- VexRiscV shift bus fail HOT 3
- rdcycle and rdinstret instructions not working HOT 2
- default bus doesn't expose write mask
- Help for custom instruction HOT 7
- Wrong speculative execution when conditional branch argument is in TCM address range HOT 1
- how to send data serially using apbbus when using murax soc HOT 4
- Internal timer implementation HOT 1
- machineCsr test failing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vexriscv.