-
Notifications
You must be signed in to change notification settings - Fork 267
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
Fixed clock alignment in axi_stream_master vc #420
Fixed clock alignment in axi_stream_master vc #420
Conversation
…one in axi_lite_master before, to keep alignment with the clock edge and make it possible to implement a wait_until_idle. After handling a wait_for_time message, there is a realignment with the clock as well. To still be able to run at full speed, the queue is processed until it is empty before waiting for another rising edge. Added an extra test to the testbench to verify clock alignment. Slightly modified other tests according to changed timing behavior. Added 'wait until idle' to pop before push test to verify it's behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, there is just a memory leak to fix.
else | ||
if pop_boolean(msg) then | ||
tlast <= '1'; | ||
msg := pop(message_queue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The msg needs to be deallocated unless memory will leak. Previously the msg was deallocated by being passed into the receive procedure in the main process. Now the msg is nulled in the main process when being pushed into the queue since ownership is transfered and thus it must be explicitly deallocated in the bus_process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, will change that.. Technically it also needs to be done after the unexpected_msg_type call in the main process I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it could have been done explicitly in the main process as well but the receive procedure will deallocate its input argument if it is non-null so there was no memory leak in the original code. Maybe it is confusing and could be more readable with an explicit deallocate.
…ed from the queue
…re with mocked checks. Apparently there is a difference between GHDL and modelsim in this aspect. Modelsim simulation passed without waiting on tvalid='1' and just an extra 'wait until rising_edge(aclk)', ghdl needs more.
Split axi stream master process into two separate processes, as was done in axi_lite_master before, to keep alignment with the clock edge and make it possible to implement a wait_until_idle. After handling a wait_for_time message, there is a realignment with the clock as well. To still be able to run at full speed, the queue is processed until it is empty before waiting for another rising edge.
Added an extra test to the testbench to verify clock alignment.
Slightly modified other tests according to changed timing behavior.
Added 'wait until idle' to pop before push test to verify it's behavior.