PSS Bindings¶
GenPSS produces one .pss file per package containing component
declarations with function prototypes, suitable for use with PSS tools
such as zuspec.
Generated Artifacts¶
$ python -m ml_hpi generate --spec spec.yaml --outdir gen/ --lang pss
For a spec whose interfaces share the package prefix pkg, the generator
produces pkg.pss:
package pkg {
component RegIf {
target function void write32(addr_t addr, bit<32> data); // ml-hpi: blocking=true
target function bit<32> read32(addr_t addr); // ml-hpi: blocking=true
target function void reset(); // ml-hpi: blocking=false
}
component BusIf {
RegIf regs;
array<RegIf, *> ports;
}
component ExtRegIf : RegIf {
target function void configure(bit<32> mode); // ml-hpi: blocking=false
}
} // package pkg
Method Mapping¶
ml-hpi construct |
PSS output |
|---|---|
Method (target) |
|
Method (non-target) |
|
Member (field) |
|
Member (array) |
|
Inheritance |
|
The blocking attribute is not a PSS language keyword. The generator
encodes it as a trailing // ml-hpi: blocking=true|false comment so the
parser can recover it on round-trip.
Type Mapping¶
ml-hpi |
PSS |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PSS Parser¶
ParsePSS parses PSS component declarations back to an MlHpiDoc.
It handles the structured output produced by GenPSS, including
// ml-hpi: pragma comments for round-trip fidelity.
$ python -m ml_hpi parse --lang pss --input pkg.pss --output recovered.yaml
Limitations:
addr_tmaps back to the genericaddrtype; the specific width (addr32/addr64) is lost.blockingis recovered from// ml-hpi:pragma comments. Without these comments, the parser defaults toTruefor target functions.PSS
actiontypes are not part of the ml-hpi interface model and are skipped.