Skip to content

Conversation

@sequencer
Copy link
Member

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Feature (or new API)

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference).

Release Notes

Add HasExtModuleDefine.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.5.x, 3.6.x, or 5.x depending on impact, API modification or big change: 6.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash), clean up the commit message, and label with Please Merge.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

@sequencer sequencer added the Feature New feature, will be included in release notes label Aug 13, 2023
*/
def define[T <: chisel3.Element](tpe: T, path: Seq[String]): T = {
setInline(
s"firrtl_abi_definition_${path.mkString("_")}.sv",
Copy link
Member

Choose a reason for hiding this comment

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

Aw, this is what ref statements were intended for. They're not really used so no worries, the verilog ABI files is what we have!

The filename (and portion after "ref_" in the define) have specific rules, should these be automatically populated based on the circuit / module (def?) names?

Ports of ref type shall be lowered to a Verilog macro of the form `define ref_<circuit name>_<module name>_<portname> <internal path from module> in a
file with name ref_<circuit name>_<module name>.sv.

These need to be output ports, and maybe if we're teaching Chisel about ABI either user is entirely responsible or we would do the necessary handling for aggregates/names?

Anyway, fly-by, just some thoughts!

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I'll be too busy next week, I'm drafting and using this API in https://github.com/sequencer/riscv-cosim. After I think this API is good enough I'll be back to upstream to Chisel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature, will be included in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants