From: Cesar Strauss Date: Sat, 26 Sep 2020 17:30:09 +0000 (-0300) Subject: Convert a few more tests to be able to use cxxsim X-Git-Tag: 24jan2021_ls180~308 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=37b628cada807b9f8fdc868f8ea56c6937291fca;p=soc.git Convert a few more tests to be able to use cxxsim --- diff --git a/src/soc/experiment/alu_hier.py b/src/soc/experiment/alu_hier.py index 9c8115ce..dd03932d 100644 --- a/src/soc/experiment/alu_hier.py +++ b/src/soc/experiment/alu_hier.py @@ -14,7 +14,10 @@ from nmigen.hdl.rec import Record, Layout from nmigen.cli import main from nmigen.cli import verilog, rtlil from nmigen.compat.sim import run_simulation -from nmigen.back.pysim import Simulator, Settle + +# NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell +# Also, check out the cxxsim nmigen branch, and latest yosys from git +from nmutil.sim_tmp_alternative import Simulator from soc.decoder.power_enums import MicrOp, Function, CryIn diff --git a/src/soc/fu/alu/test/test_pipe_caller.py b/src/soc/fu/alu/test/test_pipe_caller.py index 45701eb6..9b0c7330 100644 --- a/src/soc/fu/alu/test/test_pipe_caller.py +++ b/src/soc/fu/alu/test/test_pipe_caller.py @@ -14,19 +14,10 @@ import unittest from nmigen.cli import rtlil from nmutil.formaltest import FHDLTestCase from nmigen import Module, Signal -from nmigen.back.pysim import Delay, Settle -# NOTE: to use this (set to True), at present it is necessary to check -# out the cxxsim nmigen branch -cxxsim = False -if cxxsim: - try: - from nmigen.sim.cxxsim import Simulator - except ImportError: - print("nope, sorry, have to use nmigen cxxsim branch for now") - cxxsim = False - from nmigen.back.pysim import Simulator -else: - from nmigen.back.pysim import Simulator + +# NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell +# Also, check out the cxxsim nmigen branch, and latest yosys from git +from nmutil.sim_tmp_alternative import Simulator, Settle def get_cu_inputs(dec2, sim): diff --git a/src/soc/fu/compunits/test/test_compunit.py b/src/soc/fu/compunits/test/test_compunit.py index 91598935..03e76435 100644 --- a/src/soc/fu/compunits/test/test_compunit.py +++ b/src/soc/fu/compunits/test/test_compunit.py @@ -1,5 +1,9 @@ from nmigen import Module, Signal, ResetSignal -from nmigen.back.pysim import Simulator, Delay, Settle + +# NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell +# Also, check out the cxxsim nmigen branch, and latest yosys from git +from nmutil.sim_tmp_alternative import Simulator, Settle + from nmutil.formaltest import FHDLTestCase from nmigen.cli import rtlil import unittest diff --git a/src/soc/fu/div/test/helper.py b/src/soc/fu/div/test/helper.py index d9c8a718..3b57b529 100644 --- a/src/soc/fu/div/test/helper.py +++ b/src/soc/fu/div/test/helper.py @@ -2,7 +2,11 @@ import random import unittest import power_instruction_analyzer as pia from nmigen import Module, Signal -from nmigen.back.pysim import Simulator, Delay + +# NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell +# Also, check out the cxxsim nmigen branch, and latest yosys from git +from nmutil.sim_tmp_alternative import Simulator, Delay + from soc.decoder.power_decoder import (create_pdecode) from soc.decoder.power_decoder2 import (PowerDecode2) from soc.decoder.power_enums import XER_bits, Function diff --git a/src/soc/fu/logical/test/test_pipe_caller.py b/src/soc/fu/logical/test/test_pipe_caller.py index 794e9fcd..f5f319fa 100644 --- a/src/soc/fu/logical/test/test_pipe_caller.py +++ b/src/soc/fu/logical/test/test_pipe_caller.py @@ -1,5 +1,9 @@ from nmigen import Module, Signal -from nmigen.back.pysim import Simulator, Delay, Settle + +# NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell +# Also, check out the cxxsim nmigen branch, and latest yosys from git +from nmutil.sim_tmp_alternative import Simulator, Settle + from nmutil.formaltest import FHDLTestCase from nmigen.cli import rtlil import unittest diff --git a/src/soc/fu/mul/test/test_pipe_caller.py b/src/soc/fu/mul/test/test_pipe_caller.py index 1c2ad912..934138a5 100644 --- a/src/soc/fu/mul/test/test_pipe_caller.py +++ b/src/soc/fu/mul/test/test_pipe_caller.py @@ -1,5 +1,9 @@ from nmigen import Module, Signal -from nmigen.sim.pysim import Simulator, Delay, Settle + +# NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell +# Also, check out the cxxsim nmigen branch, and latest yosys from git +from nmutil.sim_tmp_alternative import Simulator, Delay, Settle + from nmigen.cli import rtlil import unittest from soc.decoder.isa.caller import ISACaller, special_sprs diff --git a/src/soc/fu/spr/test/test_pipe_caller.py b/src/soc/fu/spr/test/test_pipe_caller.py index 4c5fb39c..e939a699 100644 --- a/src/soc/fu/spr/test/test_pipe_caller.py +++ b/src/soc/fu/spr/test/test_pipe_caller.py @@ -1,5 +1,9 @@ from nmigen import Module, Signal -from nmigen.back.pysim import Simulator, Delay, Settle + +# NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell +# Also, check out the cxxsim nmigen branch, and latest yosys from git +from nmutil.sim_tmp_alternative import Simulator, Settle + from nmigen.cli import rtlil import unittest from soc.decoder.isa.caller import ISACaller, special_sprs diff --git a/src/soc/fu/trap/test/test_pipe_caller.py b/src/soc/fu/trap/test/test_pipe_caller.py index aa45b6c7..1cc4c423 100644 --- a/src/soc/fu/trap/test/test_pipe_caller.py +++ b/src/soc/fu/trap/test/test_pipe_caller.py @@ -1,5 +1,9 @@ from nmigen import Module, Signal -from nmigen.back.pysim import Simulator, Delay, Settle + +# NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell +# Also, check out the cxxsim nmigen branch, and latest yosys from git +from nmutil.sim_tmp_alternative import Simulator, Settle + from nmutil.formaltest import FHDLTestCase from nmigen.cli import rtlil import unittest diff --git a/src/soc/simple/test/test_issuer.py b/src/soc/simple/test/test_issuer.py index edcfb4f7..08361c99 100644 --- a/src/soc/simple/test/test_issuer.py +++ b/src/soc/simple/test/test_issuer.py @@ -5,7 +5,11 @@ related bugs: * https://bugs.libre-soc.org/show_bug.cgi?id=363 """ from nmigen import Module, Signal, Cat -from nmutil.sim_tmp_alternative import Simulator, Delay, Settle + +# NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell +# Also, check out the cxxsim nmigen branch, and latest yosys from git +from nmutil.sim_tmp_alternative import Simulator, Settle + from nmutil.formaltest import FHDLTestCase from nmigen.cli import rtlil import unittest