From: Cesar Strauss Date: Wed, 7 Jul 2021 09:36:50 +0000 (-0300) Subject: Start of a GTKWave document for the LDST CompUnit parallel unit test X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b16facc1f4b0b9dc7f2e6a6756199bd9ea38b91;p=soc.git Start of a GTKWave document for the LDST CompUnit parallel unit test --- diff --git a/src/soc/experiment/test/test_compldst_multi.py b/src/soc/experiment/test/test_compldst_multi.py index 1f212514..5bb3c6ee 100644 --- a/src/soc/experiment/test/test_compldst_multi.py +++ b/src/soc/experiment/test/test_compldst_multi.py @@ -4,6 +4,7 @@ import unittest from nmigen import Module from nmigen.sim import Simulator +from nmutil.gtkw import write_gtkw from openpower.consts import MSR from openpower.decoder.power_enums import MicrOp, LDSTMode @@ -54,11 +55,12 @@ class TestLDSTCompUnit(unittest.TestCase): m = Module() pi = PortInterface(name="pi") regspec = LDSTPipeSpec.regspec - dut = LDSTCompUnit(pi, regspec) + dut = LDSTCompUnit(pi, regspec, name="ldst") m.submodules.dut = dut sim = Simulator(m) sim.add_clock(1e-6) op = OpSim(dut) + self.write_gtkw() def process(): yield from op.issue(MicrOp.OP_STORE) @@ -68,6 +70,25 @@ class TestLDSTCompUnit(unittest.TestCase): with sim_writer: sim.run() + @classmethod + def write_gtkw(cls): + traces = [ + 'clk', + ('operation', [ + ('oper_i_ldst__insn_type', {'display': 'insn_type'}), + ('oper_i_ldst__ldst_mode', {'display': 'ldst_mode'}), + ('oper_i_ldst__zero_a', {'display': 'zero_a'}), + ('oper_i_ldst__imm_data__ok', {'display': 'imm_data_ok'}), + ('oper_i_ldst__imm_data__data[63:0]', + {'display': 'imm_data_data', 'base': 'dec'}) + ]), + ('cu_issue_i', {'display': 'issue_i'}), + ('cu_busy_o', {'display': 'busy_o'}) + ] + write_gtkw("test_ldst_compunit.gtkw", + "test_ldst_compunit.vcd", + traces, module="top.dut") + if __name__ == '__main__': unittest.main()