opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[util/design] Create a make-ip script that generates directory structure and boilerplate files

Open msfschaffner opened this issue 5 years ago • 5 comments

It would be really nice to have a simple make-comportable-ip script that automatically creates the directory structure and basic files needed (similar to how fpvgen, uvmdvgen or make_new_dif work). This would make the process of creating a new comportable IP a bit less cumbersome and faster, since we currently just manually copy these files over from other existing IPs.

Files that could be generated with such a script:

  • prj.hjson
  • example hjson
  • checklist markdown
  • documentation markdown
  • fusesoc core file
  • empty lint waivers
  • empty RTL shell

msfschaffner avatar Feb 10 '21 02:02 msfschaffner

Maybe if the directory already exists it could check and say what is missing (with an option to create the baseline)? (I am fairly sure usbdev and usbuart have fallen behind the times)

mdhayter avatar Feb 10 '21 02:02 mdhayter

Since this sort of script only gets run every couple of months, it's always out of date in my experience. My preference is to just copy a folder and use sed to rename appropriately.

rswarbrick avatar Feb 10 '21 11:02 rswarbrick

This sounds like a "good first issue". I agree with @rswarbrick that such scripts tend to get out of date. However, copying over a folder and start to edit doesn't sound like the perfect solution either: Which folder/IP should users start from? A second use case of the script would be to create documentation for the directory structure.

vogelpi avatar Feb 12 '21 08:02 vogelpi

@rswarbrick , @vogelpi I read what you mentioned and completely understand the concern about the script falling out of date. So, I was thinking of building the script in Python and using Jinja2 for the boilerplate files. This way we separate the directory-generation logic from the file contents, making it much easier to update the templates in the future without having to rewrite the script itself.

let me know what do you think and if i could work on this issue if it's still open

rknastenka avatar May 25 '26 15:05 rknastenka

I am closing this old issue because I don't think it's really a priority anymore.

vogelpi avatar Sep 22 '26 20:09 vogelpi