Skip to content
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

Use DPIC-function to return deferred result #250

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

klin02
Copy link
Member

@klin02 klin02 commented Jan 15, 2024

Before this commit, we fetch simv_result at 5000 cycles. Only when the result is not zero, it works and stop simulation.

Now we use DPIC task to implement the return of simv_result when not zero, so only one DPIC task will be used to stop simulation. That will reduce the cost of fetch and get result return faster.

@klin02 klin02 requested a review from poemonsense January 15, 2024 12:32
if ((~simv_result) && (|step)) begin
simv_nstep(step);
end
if (~reset && (~simv_result) && (|step)) begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use ! instead of ~, step != 0 instead of |step for logic operations.

@poemonsense
Copy link
Member

Use one short sentence for the commit title please. See Chisel commits: https://github.com/chipsalliance/chisel/commits/main/

@klin02 klin02 force-pushed the deferred-return-result branch from b951c35 to 94717c5 Compare January 15, 2024 13:06
@klin02 klin02 changed the title Deferred result: use DPIC-task to return it, avoid checking at intervals Use DPIC-task to return deferred result Jan 15, 2024
@klin02 klin02 requested a review from poemonsense January 15, 2024 13:08
if ((~simv_result) && (|step)) begin
simv_nstep(step);
end
if ((!reset) && (!simv_result) && (step != 0)) begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the extra braces () but it's ok

poemonsense
poemonsense previously approved these changes Jan 15, 2024
poemonsense
poemonsense previously approved these changes Jan 16, 2024
@klin02
Copy link
Member Author

klin02 commented Jan 16, 2024

The DPIC-task is contained in GFIFO function,which unsupport output. I will check whether it works

@klin02 klin02 marked this pull request as draft January 16, 2024 02:53
@klin02 klin02 force-pushed the deferred-return-result branch 3 times, most recently from d767424 to b948d6c Compare January 17, 2024 08:52
Before this commit, we fetch simv_result at 5000 cycles. Only
when the result is not zero, it works and stop simulation.

Now we use DPIC task to implement the return of simv_result when not
zero, so only one DPIC task will be used to stop simulation.
That will reduce the cost of fetch and get result return faster.
@klin02 klin02 marked this pull request as ready for review January 17, 2024 08:53
@klin02
Copy link
Member Author

klin02 commented Jan 17, 2024

The DPIC-task is contained in GFIFO function,which unsupport output. I will check whether it works

To return a value in GFIFO function, we can use SFIFO DPIC function to set it.

@klin02 klin02 requested a review from poemonsense January 17, 2024 09:00
@klin02 klin02 changed the title Use DPIC-task to return deferred result Use DPIC-function to return deferred result Jan 18, 2024
@klin02 klin02 merged commit b1ff113 into OpenXiangShan:master Jan 18, 2024
3 checks passed
pxk27 pushed a commit to pxk27/difftest that referenced this pull request Jan 30, 2024
Before this commit, we fetch simv_result at 5000 cycles. Only
when the result is not zero, it works and stop simulation.

Now we use DPIC function to implement the return of simv_result when not
zero, so only one DPIC function will be used to stop simulation.
That will reduce the cost of fetch and get result return faster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants