QCodeGen -- A C-Block Component Code Generator For QSpice

The built-in QSpice C-Block code generator is a nice feature but I wanted something a bit more flexible. So I built a stand-alone code generator. Maybe you’ll find it useful.

Key features include:

  • Generates code using custom user-defined templates.
  • Updates existing *.cpp code for schematic component changes with minimal programmer effort.
  • Generates code without overwriting existing *.cpp files.
  • Detects malformed component port and string attributes that cause QSpice to generate invalid code.

If you’re interested, QCodeGen binaries and sources are available on the dev branch of my GitHub repo.

If you try it, let me know what you think.

–robert

3 Likes

QCodeGen v0.9.4 sources and binaries are now available on the dev branch of my GitHub repo.

  • Improved parsing of double/float attributes for multiplier suffixes and engineering notation.
  • Summary/Code tabs now display extended ASCII symbols properly.
  • Other minor fixes.

–robert

1 Like

QCodeGen v0.9.5.1 sources and binaries are now available on the dev branch of my GitHub QSpice repository.

This is a first pass at basic support for connecting “bus wires” to C-Block components as discussed in my recent C-Block Basics #6 paper. At this point, the code generator should produce proper code (i.e., equivalent to the QSpice code generator) for valid schematic blocks and continue to provide warnings that QSpice may not provide at template code-generation time.

The next step is to implement something akin to Bit Vectors for “boolean bus ports” as described in the aforementioned C-Block Basics #6 paper.

Anyway, it’s available but needs much more testing. As always, please let me know if you find any problems, have suggestions for improvements, etc.

–robert

1 Like