HardwareIR / netlistDB

netlistDB - Intermediate format for digital hardware representation with graph database API
MIT License
29 stars 2 forks source link

verilog serializer #5

Open Nic30 opened 5 years ago

Nic30 commented 5 years ago

depends on #6

Nic30 commented 5 years ago

I was thinking we could use jinja2 templates for HDL generating and thus greatly reduce development time and improve flexibility and shrink codebase. However all Jinja2 libraries for C++, which I have found, do have some problem.

https://github.com/pantor/inja

https://github.com/flexferrum/Jinja2Cpp

https://github.com/hughperkins/Jinja2CppLight

Maybe I am just bad at searching but I did not find anything else and I can not fix Jinja2Cpp because they do not want to, I do not have time to fix Inja or implement Jinja2CppLight.

So the template of the HDL feature (e.g. if statement) will be implemented in virtual method of the serializer.

Nic30 commented 5 years ago

simple module serialization working https://github.com/HardwareIR/netlistDB/blob/4e366e5b4adbf3797e87691251ac0c630f3cfaef/tests/verilog_simple_modules_test.cpp

What should work:

Nic30 commented 5 years ago
  • missing serialization machinery which will generate proper file structure for the hierarchical design.

[done] this requires to put output stream reference to the serializer object properties and switch the output stream to new file if the new module is serialized