Hello All,
I am implementing a driver for the bus protocol using statemachine flow,
the statemachine has the following states,
IDLE, COMMAND, RESPONSE, READ_DATA, WRITE_DATA.
IDLE - reset
COMMAND - my actual command frame should be driven on bus
RESPONSE - receive response from the slave or DUT
READ_DATA - if the operation is a read after the bus turn around time i start receiving the data(just for parity calculation and retry if any error is there)
WRITE_DATA - if the operation is write, the driver starts sending the data on the bus io.
the difficulty am having is,
the transition from one state to another takes one clock,
so for eg - if first clock is IDLE and next clock if it moves to COMMAND, i immediately want to send the command on bus,but my present implementation is in the COMMAND state i call a task drive_command and it looks for posedge and then drives the data, so what happens is only in the third clock my data is being driven outside, how do i avoid this?
also my implementation is in COMMAND state i do a “get_next_item” and in end of READ_DATA/WRITE_DATA i do a “item_done”, is this fine?
i also have scenarios like i may have to perform a write transaction immediately after a read transaction, so all i have is just one IDLE clock inbetween the end of READ data phase and next WRITE command.
my requirement is as soon as i enter COMMAND i want the command to be driven onto bus immediately.
please help guys…
maximus…