Skip to content

Commit

Permalink
odb: adding support for persistent DFT structures
Browse files Browse the repository at this point in the history
This is a basic set of structs to support scan chains and scan cells in
odb.
  • Loading branch information
fgaray committed Feb 20, 2024
1 parent 59acbf4 commit 2729a53
Show file tree
Hide file tree
Showing 27 changed files with 1,200 additions and 118 deletions.
104 changes: 100 additions & 4 deletions src/odb/include/odb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class dbViaParams;

// Generator Code Begin ClassDeclarations
class dbAccessPoint;
class dbDft;
class dbGCellGrid;
class dbGlobalConnect;
class dbGroup;
Expand Down Expand Up @@ -1360,6 +1361,16 @@ class dbBlock : public dbObject
///
dbExtControl* getExtControl();

///
/// Get the dbDft object for persistent dft structs
///
dbDft* createDft();

///
/// Get the dbDft object for persistent dft structs
///
dbDft* getDft() const;

///
/// Get the extraction corner names
///
Expand Down Expand Up @@ -7067,6 +7078,22 @@ class dbAccessPoint : public dbObject
// User Code End dbAccessPoint
};

class dbDft : public dbObject
{
public:
void setScanInserted(bool scan_inserted);

bool isScanInserted() const;

dbSet<dbScanChain> getScanChains() const;

// User Code Begin dbDft
dbId<dbScanPin> CreateScanPin(dbBTerm* bterm);
dbId<dbScanPin> CreateScanPin(dbITerm* iterm);
dbScanChain* CreateScanChain();
// User Code End dbDft
};

class dbGCellGrid : public dbObject
{
public:
Expand Down Expand Up @@ -7701,22 +7728,91 @@ class dbPowerSwitch : public dbObject
class dbScanChain : public dbObject
{
public:
dbSet<dbScanPartition> getScanPartitions() const;

dbSet<dbScanInst> getScanInsts() const;

// User Code Begin dbScanChain
std::string_view getName() const;

void setName(std::string_view name);

void setScanIn(dbBTerm* scan_in);
dbBTerm* getScanIn() const;

void setScanOut(dbBTerm* scan_out);
dbBTerm* getScanOut() const;

void setScanEnable(dbBTerm* scan_enable);

dbBTerm* getScanEnable() const;

std::string_view getTestMode() const;
void setTestMode(std::string_view test_mode);

dbScanPartition* createScanPartition();
dbScanInst* createScanInst(dbInst* inst);
dbScanInst* createScanInst(const std::vector<dbInst*>& insts);
// User Code End dbScanChain
};

class dbScanInst : public dbObject
{
public:
enum class SCAN_INST_TYPE
struct AccessPins
{
OneBit,
ShiftRegister,
BlackBox
std::variant<dbBTerm*, dbITerm*> scan_in;
std::variant<dbBTerm*, dbITerm*> scan_out;
};
enum class ClockEdge
{
Rising,
Falling
};

// User Code Begin dbScanInst
void setScanClock(std::string_view scan_clock);
std::string_view getScanClock() const;

void setClockEdge(ClockEdge clock_edge);
ClockEdge getClockEdge() const;

void setBits(uint bits);

uint getBits() const;

void setScanEnable(dbBTerm* scan_enable);
void setScanEnable(dbITerm* scan_enable);
std::variant<dbBTerm*, dbITerm*> getScanEnable() const;

void setAccessPins(const AccessPins& access_pins);

AccessPins getAccessPins() const;

std::vector<dbInst*> getInsts() const;
// User Code End dbScanInst
};

class dbScanPartition : public dbObject
{
public:
// User Code Begin dbScanPartition
void setStart(dbBTerm* bterm);

void setStart(dbITerm* iterm);

void setStop(dbBTerm* bterm);

void setStop(dbITerm* iterm);

std::variant<dbBTerm*, dbITerm*> getStart() const;

std::variant<dbBTerm*, dbITerm*> getStop() const;

std::string_view getName() const;

void setName(std::string_view name);
// User Code End dbScanPartition
};

class dbScanPin : public dbObject
Expand Down
1 change: 1 addition & 0 deletions src/odb/include/odb/dbObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ enum dbObjectType
dbBPinObj,
// Generator Code Begin DbObjectType
dbAccessPointObj,
dbDftObj,
dbGCellGridObj,
dbGlobalConnectObj,
dbGroupObj,
Expand Down
25 changes: 25 additions & 0 deletions src/odb/src/codeGenerator/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,31 @@
"type":"1_n",
"tbl_name":"wrongdir_spacing_rules_tbl_",
"schema":"db_schema_wrongdir_spacing"
},
{
"first": "dbDft",
"second": "dbScanPin",
"type": "1_n",
"tbl_name": "scan_pins_",
"flags": ["no-get"]
},
{
"first": "dbScanChain",
"second": "dbScanPartition",
"type": "1_n",
"tbl_name": "scan_partitions_"
},
{
"first": "dbScanChain",
"second": "dbScanInst",
"type": "1_n",
"tbl_name": "scan_insts_"
},
{
"first": "dbDft",
"second": "dbScanChain",
"type": "1_n",
"tbl_name": "scan_chains_"
}
]
}
13 changes: 13 additions & 0 deletions src/odb/src/codeGenerator/schema/scan/dbDft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "dbDft",
"type": "dbObject",
"fields": [
{
"name": "scan_inserted_",
"type": "bool"
}
],
"h_includes": [
"dbBlock.h"
]
}
40 changes: 11 additions & 29 deletions src/odb/src/codeGenerator/schema/scan/dbScanChain.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,39 @@
"type": "std::string",
"flags": ["private"]
},
{
"name": "length_",
"type": "uint",
"flags": ["private"]
},
{
"name": "cells_",
"type": "dbVector<dbId<dbInst>>",
"flags": ["private"]
},
{
"name": "scan_in_",
"type": "dbId<dbScanPin>",
"type": "dbId<dbBTerm>",
"flags": ["private"]
},
{
"name": "scan_out_",
"type": "dbId<dbScanPin>",
"flags": ["private"]
},
{
"name": "scan_clock_",
"type": "dbId<dbScanPin>",
"type": "dbId<dbBTerm>",
"flags": ["private"]
},
{
"name": "scan_enable_",
"type": "dbId<dbScanPin>",
"type": "dbId<dbBTerm>",
"flags": ["private"]
},
{
"name": "test_mode_",
"type": "std::string",
"flags": ["private"]
},
{
"name": "partitions_",
"type": "dbVector<dbId<dbScanPartition>>",
"flags": ["private"]
},
{
"name": "scan_insts_",
"type": "dbVector<dbId<dbScanInst>>",
"flags": ["private"]
}
],
"h_includes": [
"dbVector.h",
"dbScanPin.h"
],
"cpp_includes": [
"dbScanPin.h"
"dbScanPin.h",
"dbScanPartition.h",
"dbScanInst.h",
"dbBlock.h",
"dbDft.h"
],
"classes": [
"dbScanPartition"
]
}
58 changes: 46 additions & 12 deletions src/odb/src/codeGenerator/schema/scan/dbScanInst.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,71 @@
"type": "dbObject",
"fields": [
{
"name": "bits",
"name": "bits_",
"type": "uint",
"flags": ["private"]
},
{
"name": "scanIn",
"name": "access_pins_",
"type": "std::pair<dbId<dbScanPin>, dbId<dbScanPin>>",
"flags": ["private", "no-template"]
},
{
"name": "scan_enable_",
"type": "dbId<dbScanPin>",
"flags": ["private"]
},
{
"name": "scanOut",
"type": "dbId<dbScanPin>",
"name": "insts_",
"type": "dbVector<dbId<dbInst>>",
"flags": ["private"]
},
{
"name": "scan_clock_",
"type": "std::string",
"flags": ["private"]
},
{
"name": "clock_edge_",
"type": "uint",
"flags": ["private"]
}
],
"enums": [
{
"name": "SCAN_INST_TYPE",
"public": true,
"name": "ClockEdge",
"class": true,
"values": [
"OneBit",
"ShiftRegister",
"BlackBox"
]
"Rising",
"Falling"
],
"public": true
}
],
"structs": [
{
"name": "AccessPins",
"public": true,
"fields": [
{
"name": "scan_in",
"type": "std::variant<dbBTerm*, dbITerm*>"
},
{
"name": "scan_out",
"type": "std::variant<dbBTerm*, dbITerm*>"
}
]
}
],
"h_includes": [
"dbScanPin.h"
"dbScanPin.h",
"dbInst.h",
"dbVector.h"
],
"cpp_includes": [
"dbScanPin.h"
"dbScanPin.h",
"dbDft.h",
"dbScanChain.h"
]
}
4 changes: 3 additions & 1 deletion src/odb/src/codeGenerator/schema/scan/dbScanPartition.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"dbScanPin.h"
],
"cpp_includes": [
"dbScanPin.h"
"dbScanPin.h",
"dbScanChain.h",
"dbDft.h"
]
}
12 changes: 10 additions & 2 deletions src/odb/src/codeGenerator/schema/scan/dbScanPin.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
],
"h_includes": [
"dbBTerm.h",
"dbITerm.h",
"dbBlock.h"
"dbITerm.h"
],
"cpp_includes": [
"dbBlock.h",
"dbDft.h"
],
"classes": [
"dbScanPin",
"dbBTerm",
"dbITerm"
]
}
1 change: 1 addition & 0 deletions src/odb/src/db/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ add_library(db
dbGroupGroundNetItr.cpp
# Generator Code Begin cpp
dbAccessPoint.cpp
dbDft.cpp
dbGCellGrid.cpp
dbGlobalConnect.cpp
dbGroup.cpp
Expand Down
Loading

0 comments on commit 2729a53

Please sign in to comment.