1 """simple core issuer verilog generator
5 from nmigen
.cli
import verilog
7 from soc
.config
.test
.test_loadstore
import TestMemPspec
8 from soc
.simple
.issuer
import TestIssuer
11 if __name__
== '__main__':
12 parser
= argparse
.ArgumentParser(description
="Simple core issuer " \
14 parser
.add_argument("output_filename")
15 parser
.add_argument("--enable-xics", action
="store_true",
16 help="Enable interrupts",
18 parser
.add_argument("--enable-core", action
="store_true",
19 help="Enable main core",
21 parser
.add_argument("--use-pll", action
="store_true", help="Enable pll",
23 parser
.add_argument("--enable-testgpio", action
="store_true",
24 help="Disable gpio pins",
26 parser
.add_argument("--debug", default
="jtag", help="Select debug " \
27 "interface [jtag | dmi] [default jtag]")
29 args
= parser
.parse_args()
34 'cr': 1, 'branch': 1, 'trap': 1,
42 pspec
= TestMemPspec(ldst_ifacetype
='bare_wb',
43 imem_ifacetype
='bare_wb',
48 # set to 32 for instruction-memory width=32
50 # set to 32 to make data wishbone bus 32-bit
52 xics
=args
.enable_xics
, # XICS interrupt controller
53 nocore
=not args
.enable_core
, # test coriolis2 ioring
54 use_pll
=args
.use_pll
, # bypass PLL
55 gpio
=args
.enable_testgpio
, # for test purposes
56 debug
=args
.debug
, # set to jtag or dmi
59 print("nocore", pspec
.__dict
__["nocore"])
60 print("gpio", pspec
.__dict
__["gpio"])
61 print("xics", pspec
.__dict
__["xics"])
62 print("use_pll", pspec
.__dict
__["use_pll"])
63 print("debug", pspec
.__dict
__["debug"])
65 dut
= TestIssuer(pspec
)
67 vl
= verilog
.convert(dut
, ports
=dut
.external_ports(), name
="test_issuer")
68 with
open(args
.output_filename
, "w") as f
: