diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2022-02-02 16:22:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 16:22:53 +0100 |
commit | 2d98fe870c1803ccf8d507119bc1f7ab4054d6ab (patch) | |
tree | e44448b8bb796ec434d7fe926f46c83c02f5f872 | |
parent | 518521c72e7505070ab5d2650e3b6d83e4d31311 (diff) | |
parent | 0b633b6c2e8c0dc1e2182761777bb5612f0eef23 (diff) | |
download | yosys-2d98fe870c1803ccf8d507119bc1f7ab4054d6ab.tar.gz yosys-2d98fe870c1803ccf8d507119bc1f7ab4054d6ab.tar.bz2 yosys-2d98fe870c1803ccf8d507119bc1f7ab4054d6ab.zip |
Merge pull request #3183 from YosysHQ/micko/nto1mux
Use bmux for NTO1MUX
-rw-r--r-- | frontends/verific/verific.cc | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index d5574f95a..bfd5e311a 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -798,28 +798,14 @@ bool VerificImporter::import_netlist_instance_cells(Instance *inst, RTLIL::IdStr } if (inst->Type() == OPER_NTO1MUX) { - cell = module->addShr(inst_name, IN2, IN1, net_map_at(inst->GetOutput())); + cell = module->addBmux(inst_name, IN2, IN1, net_map_at(inst->GetOutput())); import_attributes(cell->attributes, inst); return true; } if (inst->Type() == OPER_WIDE_NTO1MUX) { - SigSpec data = IN2, out = OUT; - - int wordsize_bits = ceil_log2(GetSize(out)); - int wordsize = 1 << wordsize_bits; - - SigSpec sel = {IN1, SigSpec(State::S0, wordsize_bits)}; - - SigSpec padded_data; - for (int i = 0; i < GetSize(data); i += GetSize(out)) { - SigSpec d = data.extract(i, GetSize(out)); - d.extend_u0(wordsize); - padded_data.append(d); - } - - cell = module->addShr(inst_name, padded_data, sel, out); + cell = module->addBmux(inst_name, IN2, IN1, OUT); import_attributes(cell->attributes, inst); return true; } |