From c924837dd7f9164aabb37983fb036ee34a9f1e40 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 16 Aug 2019 12:20:12 +0200 Subject: handle utrunc/strunc. For #33 --- ghdl/ghdl.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ghdl/ghdl.cc b/ghdl/ghdl.cc index 6e8de96..e92e7e9 100644 --- a/ghdl/ghdl.cc +++ b/ghdl/ghdl.cc @@ -75,6 +75,12 @@ static RTLIL::SigSpec get_src(std::vector &net_map, Net n) res.extend_u0(get_width(n), false); return res; } + case Id_Utrunc: + case Id_Strunc: + { + RTLIL::SigSpec res = IN(0); + return res.extract(0, get_width(n)); + } case Id_Const_UB32: return SigSpec(get_param_uns32(inst, 0), get_width(n)); case Id_Const_UL32: @@ -299,6 +305,8 @@ static void import_module(RTLIL::Design *design, GhdlSynth::Module m) case Id_Const_UB32: case Id_Const_UL32: case Id_Uextend: + case Id_Utrunc: + case Id_Strunc: case Id_Extract: case Id_Insert: case Id_Concat2: @@ -467,6 +475,8 @@ static void import_module(RTLIL::Design *design, GhdlSynth::Module m) case Id_Const_UB32: case Id_Const_UL32: case Id_Uextend: + case Id_Utrunc: + case Id_Strunc: case Id_Extract: case Id_Insert: case Id_Concat2: -- cgit v1.2.3