| # How to add new classes/structures to OpenROAD's schema? |
|
|
| Tool: OpenDB |
|
|
| Subcategory: Code generation issue |
|
|
| ## Conversation |
|
|
| ### fgaray |
| Hello OpenRoad devs,
|
|
|
| I am following https://github.com/The-OpenROAD-Project/OpenROAD/discussions/3619 to implement a structure to share scan chain data between OpenROAD's components but I am blocked at an compile issue.
|
|
|
| See: https://github.com/fgaray/OpenROAD/tree/ctl_db, path src/odb/src/codeGenerator/schema/scan
|
|
|
| I am adding 3 new *.json files: dbScanInst.json dbScanPartition.json dbScanPin.json
|
|
|
| In dbScanPin.json I am defining an "union" of dbBTerm and dbITerm
|
|
|
| In dbScanPartition.json I am trying to use dbScanPin for my "start" and "stop" fields.
|
|
|
|
|
| I am running the ./generate script in src/odb/src/codeGenerator to generate the C++ code but I am getting the following error:
|
|
|
| 
|
|
|
| Looks like it is trying to use dbScanPin in the private dbScanPartition.h class, but if I change it to _dbScanPin in my dbScanPartition.json, then it fails in the public class definition in db.h.
|
|
|
| Is there an step that I am missing or maybe some config?
|
|
|
| Thanks!
|
|
|
|
|
| ### maliberty |
| Use dbId to store references to other db objects
|
| ```
|
| "name": "start",
|
| - "type": "dbScanPin"
|
| + "type": "dbId<dbScanPin>"
|
| },
|
| {
|
| "name": "stop",
|
| - "type": "dbScanPin"
|
| + "type": "dbId<dbScanPin>"
|
| },
|
| ``` |
|
|
| ### fgaray |
| I forgot to close this issue, but the answer was given by @maliberty .
|
|
|
| Writing the custom setter was the way to go when implementing this. |
|
|
|
|