AIbra11
New Contributor
4 years agoReading inputs in a state-machine
Hello,
I've spent a lot of time trying to get this state machine working with no hope.
Requirement: In this FSM, we want to set:
- opcode_reg and offset_reg to USB3_DATA(3 downto 0) and USB_DATA(15 downto 4) respectively in GET_OPCODE_OFFSET state (and keep its value after that)
- RegLengthCounter to unsigned(USB3_DATA(11 downto 0)), and RegPointer to unsigned(OffsetReg) in GET_LENGTH state. (and keep its value after that)
Here is the code I've written so far (attached), specifically processes:
USB_CLK_PROC and RegProxy_FSM_Proc
Problem:
- The data is registered correctly, but changes at the next clock edge, how can I keep it fixed?