Clone wiki

pygen / Home


This is an simple tool that help add/edit data from datasheets in such coreboot utils as msrtool, superiotool, etc... It consists from two parts: small *.c files, which do export of already exists C code into xml definitions file, and main module -, which produce *.c files and patches for C code from xml data definitions. Also it contain simple gui module, written on PyQt4, which allow easy add/edit data to/from xml definitions.

Exporting already exist data in *.c files


  1. copy export_msr.c into mrstool directory
  2. compile it: "gcc -s -o export_msr export_msr.c"
  3. run: "./export_msr"
  4. copy all *.msr.xml files somewhere you want

Super I/O

  1. copy export_sio.c into superiotool directory
  2. because in superiotool we have identical names for different superio vendors *.c files we need produce export version for each file separately:
    1. gcc -s -o export_sio_ali -DALI export_sio.c
    2. gcc -s -o export_sio_ite -DITE export_sio.c
    3. ...
  3. then run all utilities: "./export_sio_*"
  4. copy all *.sio.xml files somewhere you want

Producing C code from xml definitions

All definitions must be in <project_dir>/data in each section:

  • for msr - in /data/msr/*.msr.xml
  • for superio - in /data/sio/*.sio.xml

Then you need start python3

It generates C files and put them in "../msrtool" , "../superiotool" After generation you need check C code for consistency and then compile