Skip to content

Commit

Permalink
Unit test db creation with delimiters
Browse files Browse the repository at this point in the history
Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Dec 17, 2024
1 parent 1cf4943 commit ac40e4f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/odb/test/cpp/helper/helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ dbMaster* createMaster2X1(dbLib* lib,
return master;
}

dbMaster* createMaster1X1(dbLib* lib,
const char* name,
uint width,
uint height,
const char* in1,
const char* out)
{
dbMaster* master = dbMaster::create(lib, name);
master->setWidth(width);
master->setHeight(height);
master->setType(dbMasterType::CORE);
dbMTerm::create(master, in1, dbIoType::INPUT, dbSigType::SIGNAL);
dbMTerm::create(master, out, dbIoType::OUTPUT, dbSigType::SIGNAL);
master->setFrozen();
return master;
}

dbDatabase* createSimpleDB()
{
utl::Logger* logger = new utl::Logger();
Expand All @@ -68,6 +85,7 @@ dbDatabase* createSimpleDB()
dbBlock::create(chip, "simple_block");
createMaster2X1(lib, "and2", 1000, 1000, "a", "b", "o");
createMaster2X1(lib, "or2", 500, 500, "a", "b", "o");
createMaster1X1(lib, "inv1", 500, 500, "ip0", "op0");
return db;
}

Expand Down
6 changes: 6 additions & 0 deletions src/odb/test/cpp/helper/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ odb::dbMaster* createMaster2X1(odb::dbLib* lib,
const char* in1,
const char* in2,
const char* out);
odb::dbMaster* createMaster1X1(odb::dbLib* lib,
const char* name,
uint width,
uint height,
const char* in1,
const char* out);

odb::dbDatabase* createSimpleDB();

Expand Down

0 comments on commit ac40e4f

Please sign in to comment.