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

How can I initial the pipeline registers? #324

Open
ZhengJuzhong666 opened this issue Mar 13, 2023 · 3 comments
Open

How can I initial the pipeline registers? #324

ZhengJuzhong666 opened this issue Mar 13, 2023 · 3 comments

Comments

@ZhengJuzhong666
Copy link

ZhengJuzhong666 commented Mar 13, 2023

Hello, I would like to initialize the pipeline registers in the code shown below. I used the method below, but when I use FPU, I get this error.

the origin code: (Line 124 at pipeline.scala)

inputDefault := RegNextWhen(stageBefore.output(key), stage.dontSample.getOrElse(key, Nil).foldLeft(!stage.arbitration.isStuck)(_ && !_)).setName(s"${stageBefore.getName()}_to_${stage.getName()}_${key.getName()}")

my code:

stageBeforeData init(B(0, stageBefore.output(key).getBitsWidth bits))
inputDefault.assignFromBits(stageBeforeData)
inputDefault.setName(s"${stageBefore.getName()}_to_${stage.getName()}_${key.getName()}")

the code where the error occurred: (Line 313 at FpuPlugin.scala)

    Component.current.afterElaboration{
      pipeline.stages.tail.foreach(_.input(FPU_FORKED).init(False))
    }

the error:
image

How can I initialize the registers correctly? Thank you!

@ZhengJuzhong666 ZhengJuzhong666 changed the title How can I How can I initial the pipeline registers? Mar 13, 2023
@Dolu1990
Copy link
Member

Hi,

Hmm i'm not exactly sure of your actual setup. can you share the modifications ?
Also, if i understand well, the error pop up in Line 313 at FpuPlugin.scala, while you didn't modified that file right ?

@ZhengJuzhong666
Copy link
Author

Thank you!

I modified this part of the code.
Line 128 is the original code. The commented code above is the part I want to modify. I want to instead line 128 with commented code.
image
I understand this is the code used to pass signals in the CPU pipeline. But I don't know much about the specific design of the FPU unit, so it's not clear to me why this variable won't be instantiated as a register.

@Dolu1990
Copy link
Member

Hi, sorry for the delay,

I understand this is the code used to pass signals in the CPU pipeline.

yes that's right.
So i think the issue is that it doesn't like the "assignFromBits being used here.
:= isn't working ? else, assignFrom ?

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

No branches or pull requests

2 participants