Download chips/yosys/tests/unit/kernel/modindexTest.cc from STAR-future/Trinity-SciData: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/tests/unit/kernel/modindexTest.cc
- Command line
-
hf download hf://datasets/STAR-future/Trinity-SciData/chips/yosys/tests/unit/kernel/modindexTest.cc
-
curl -L -o modindexTest.cc https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/tests/unit/kernel/modindexTest.cc
1.17 kB
| YOSYS_NAMESPACE_BEGIN | |
| TEST(ModIndexSwapTest, has) | |
| { | |
| Design* d = new Design; | |
| Module* m = d->addModule("$m"); | |
| Wire* o = m->addWire("$o", 2); | |
| o->port_input = true; | |
| Wire* i = m->addWire("$i", 2); | |
| i->port_input = true; | |
| m->fixup_ports(); | |
| m->addNot("$not", i, o); | |
| auto mi = ModIndex(m); | |
| mi.reload_module(); | |
| for (auto [sb, info] : mi.database) { | |
| EXPECT_TRUE(mi.database.find(sb) != mi.database.end()); | |
| } | |
| m->swap_names(i, o); | |
| for (auto [sb, info] : mi.database) { | |
| EXPECT_TRUE(mi.database.find(sb) != mi.database.end()); | |
| } | |
| } | |
| TEST(ModIndexDeleteTest, has) | |
| { | |
| if (logger().empty()) logger().add_sink<ConsoleLogSink>(); | |
| Design* d = new Design; | |
| Module* m = d->addModule("$m"); | |
| Wire* w = m->addWire("$w"); | |
| Wire* o = m->addWire("$o"); | |
| o->port_output = true; | |
| m->fixup_ports(); | |
| Cell* not_ = m->addNotGate("$not", w, o); | |
| auto mi = ModIndex(m); | |
| mi.reload_module(); | |
| mi.dump_db(); | |
| Wire* a = m->addWire("\\a"); | |
| not_->setPort(ID::A, a); | |
| EXPECT_TRUE(mi.ok()); | |
| } | |
| YOSYS_NAMESPACE_END | |