Skip to content

Commit

Permalink
dft: adding initial schema for DFT data sharing
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Garay <[email protected]>
  • Loading branch information
fgaray committed Nov 20, 2023
1 parent 918021c commit eee9c52
Show file tree
Hide file tree
Showing 16 changed files with 1,016 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/odb/include/odb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ class dbModule;
class dbNetTrack;
class dbPowerDomain;
class dbPowerSwitch;
class dbScanChain;
class dbScanInst;
class dbScanPartition;
class dbScanPin;
class dbTechLayer;
class dbTechLayerAreaRule;
class dbTechLayerArraySpacingRule;
Expand Down Expand Up @@ -7497,6 +7501,38 @@ class dbPowerSwitch : public dbObject
// User Code End dbPowerSwitch
};

class dbScanChain : public dbObject
{
public:
void setLength(uint length);

uint getLength() const;
};

class dbScanInst : public dbObject
{
public:
enum SCAN_INST_TYPE
{
OneBit,
ShiftRegister,
BlackBox
};
void setBits(uint bits);

uint getBits() const;
};

class dbScanPartition : public dbObject
{
public:
};

class dbScanPin : public dbObject
{
public:
};

class dbTechLayer : public dbObject
{
public:
Expand Down
4 changes: 4 additions & 0 deletions src/odb/include/odb/dbObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ enum dbObjectType
dbNetTrackObj,
dbPowerDomainObj,
dbPowerSwitchObj,
dbScanChainObj,
dbScanInstObj,
dbScanPartitionObj,
dbScanPinObj,
dbTechLayerObj,
dbTechLayerAreaRuleObj,
dbTechLayerArraySpacingRuleObj,
Expand Down
62 changes: 62 additions & 0 deletions src/odb/src/codeGenerator/schema/scan/dbScanChain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "dbScanChain",
"type": "dbObject",
"fields": [
{
"name": "name",
"type": "std::string",
"flags": ["private"]
},
{
"name": "length",
"type": "uint"
},
{
"name": "cells",
"type": "dbVector<dbId<dbInst>>",
"flags": ["private"]
},
{
"name": "scanIn",
"type": "dbId<dbScanPin>",
"flags": ["private"]
},
{
"name": "scanOut",
"type": "dbId<dbScanPin>",
"flags": ["private"]
},
{
"name": "scanClock",
"type": "dbId<dbScanPin>",
"flags": ["private"]
},
{
"name": "scanEnable",
"type": "dbId<dbScanPin>",
"flags": ["private"]
},
{
"name": "testMode",
"type": "std::string",
"flags": ["private"]
},
{
"name": "partitions",
"type": "dbVector<dbId<dbScanPartition>>",
"flags": ["private"]
},
{
"name": "scanInsts",
"type": "dbVector<dbId<dbScanInst>>",
"flags": ["private"]
}
],
"h_includes": [
"dbVector.h",
"dbScanPin.h"
],
"cpp_includes": [
"dbScanPin.h"
]
}
37 changes: 37 additions & 0 deletions src/odb/src/codeGenerator/schema/scan/dbScanInst.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "dbScanInst",
"type": "dbObject",
"fields": [
{
"name": "bits",
"type": "uint"
},
{
"name": "scanIn",
"type": "dbId<dbScanPin>",
"flags": ["private"]
},
{
"name": "scanOut",
"type": "dbId<dbScanPin>",
"flags": ["private"]
}
],
"enums": [
{
"name": "SCAN_INST_TYPE",
"public": true,
"values": [
"OneBit",
"ShiftRegister",
"BlackBox"
]
}
],
"h_includes": [
"dbScanPin.h"
],
"cpp_includes": [
"dbScanPin.h"
]
}
27 changes: 27 additions & 0 deletions src/odb/src/codeGenerator/schema/scan/dbScanPartition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "dbScanPartition",
"type": "dbObject",
"fields": [
{
"name": "start_",
"type": "dbId<dbScanPin>",
"flags": ["private"]
},
{
"name": "stop_",
"type": "dbId<dbScanPin>",
"flags": ["private"]
},
{
"name": "name",
"type": "std::string",
"flags": ["private"]
}
],
"h_includes": [
"dbScanPin.h"
],
"cpp_includes": [
"dbScanPin.h"
]
}
16 changes: 16 additions & 0 deletions src/odb/src/codeGenerator/schema/scan/dbScanPin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "dbScanPin",
"type": "dbObject",
"fields": [
{
"name": "bterm",
"type": "dbId<dbBTerm>",
"flags": ["private"]
},
{
"name": "iterm",
"type": "dbId<dbITerm>",
"flags": ["private"]
}
]
}
4 changes: 4 additions & 0 deletions src/odb/src/db/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ add_library(db
dbNetTrack.cpp
dbPowerDomain.cpp
dbPowerSwitch.cpp
dbScanChain.cpp
dbScanInst.cpp
dbScanPartition.cpp
dbScanPin.cpp
dbTechLayer.cpp
dbTechLayerAreaRule.cpp
dbTechLayerArraySpacingRule.cpp
Expand Down
4 changes: 4 additions & 0 deletions src/odb/src/db/dbObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ static const char* name_tbl[] = {"dbDatabase",
"dbNetTrack",
"dbPowerDomain",
"dbPowerSwitch",
"dbScanChain",
"dbScanInst",
"dbScanPartition",
"dbScanPin",
"dbTechLayer",
"dbTechLayerAreaRule",
"dbTechLayerArraySpacingRule",
Expand Down
168 changes: 168 additions & 0 deletions src/odb/src/db/dbScanChain.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
///////////////////////////////////////////////////////////////////////////////
// BSD 3-Clause License
//
// Copyright (c) 2022, The Regents of the University of California
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

// Generator Code Begin Cpp
#include "dbScanChain.h"

#include "db.h"
#include "dbDatabase.h"
#include "dbDiff.hpp"
#include "dbScanPin.h"
#include "dbTable.h"
#include "dbTable.hpp"
namespace odb {
template class dbTable<_dbScanChain>;

bool _dbScanChain::operator==(const _dbScanChain& rhs) const
{
if (name != rhs.name)
return false;
if (length != rhs.length)
return false;
if (scanIn != rhs.scanIn)
return false;
if (scanOut != rhs.scanOut)
return false;
if (scanClock != rhs.scanClock)
return false;
if (scanEnable != rhs.scanEnable)
return false;
if (testMode != rhs.testMode)
return false;

return true;
}

bool _dbScanChain::operator<(const _dbScanChain& rhs) const
{
return true;
}

void _dbScanChain::differences(dbDiff& diff,
const char* field,
const _dbScanChain& rhs) const
{
DIFF_BEGIN
DIFF_FIELD(name);
DIFF_FIELD(length);
DIFF_FIELD(scanIn);
DIFF_FIELD(scanOut);
DIFF_FIELD(scanClock);
DIFF_FIELD(scanEnable);
DIFF_FIELD(testMode);
DIFF_END
}

void _dbScanChain::out(dbDiff& diff, char side, const char* field) const
{
DIFF_OUT_BEGIN
DIFF_OUT_FIELD(name);
DIFF_OUT_FIELD(length);
DIFF_OUT_FIELD(scanIn);
DIFF_OUT_FIELD(scanOut);
DIFF_OUT_FIELD(scanClock);
DIFF_OUT_FIELD(scanEnable);
DIFF_OUT_FIELD(testMode);

DIFF_END
}

_dbScanChain::_dbScanChain(_dbDatabase* db)
{
}

_dbScanChain::_dbScanChain(_dbDatabase* db, const _dbScanChain& r)
{
name = r.name;
length = r.length;
scanIn = r.scanIn;
scanOut = r.scanOut;
scanClock = r.scanClock;
scanEnable = r.scanEnable;
testMode = r.testMode;
}

dbIStream& operator>>(dbIStream& stream, _dbScanChain& obj)
{
stream >> obj.name;
stream >> obj.length;
stream >> obj.cells;
stream >> obj.scanIn;
stream >> obj.scanOut;
stream >> obj.scanClock;
stream >> obj.scanEnable;
stream >> obj.testMode;
stream >> obj.partitions;
stream >> obj.scanInsts;
return stream;
}

dbOStream& operator<<(dbOStream& stream, const _dbScanChain& obj)
{
stream << obj.name;
stream << obj.length;
stream << obj.cells;
stream << obj.scanIn;
stream << obj.scanOut;
stream << obj.scanClock;
stream << obj.scanEnable;
stream << obj.testMode;
stream << obj.partitions;
stream << obj.scanInsts;
return stream;
}

_dbScanChain::~_dbScanChain()
{
}

////////////////////////////////////////////////////////////////////
//
// dbScanChain - Methods
//
////////////////////////////////////////////////////////////////////

void dbScanChain::setLength(uint length)
{
_dbScanChain* obj = (_dbScanChain*) this;

obj->length = length;
}

uint dbScanChain::getLength() const
{
_dbScanChain* obj = (_dbScanChain*) this;
return obj->length;
}

} // namespace odb
// Generator Code End Cpp
Loading

0 comments on commit eee9c52

Please sign in to comment.