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

add setOutputAsReg #1293

Merged
merged 1 commit into from
Jan 24, 2024
Merged

add setOutputAsReg #1293

merged 1 commit into from
Jan 24, 2024

Conversation

KireinaHoro
Copy link
Contributor

@KireinaHoro KireinaHoro commented Jan 23, 2024

Similar to Data.setAsReg, but aware of the port direction that it only sets output ports as register. This allows a better shorthand like the following:

val io = new Bundle {
  val masterStream = master(Stream(Bits(4 bits))) setOutputAsReg()
}

Using setAsReg here would lead to the complaint of REGISTER DEFINED AS COMPONENT INPUT.

@Dolu1990 before merging, could you check if MultiData is the right place to put this function? Alternatively, should this be the default behaviour (if direction present, set as register only when is output) for setAsReg?

@KireinaHoro
Copy link
Contributor Author

@Dolu1990 reimplemented setOutputAsReg in Data. So you think it's a good idea to keep this separate? (I don't know how to implement it in Data and merge it with setAsReg)

@Dolu1990
Copy link
Member

So you think it's a good idea to keep this separate

Yes :)

All good, thanks !

@Dolu1990 Dolu1990 merged commit 2879ece into SpinalHDL:dev Jan 24, 2024
11 checks passed
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.

None yet

2 participants