File size: 1,652 Bytes
660c0b5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# 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.
|