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", dest
='xics', action
="store_true",
16 help="Enable interrupts",
18 parser
.add_argument("--disable-xics", dest
='xics', action
="store_false",
19 help="Disable interrupts",
21 parser
.add_argument("--enable-core", dest
='core', action
="store_true",
22 help="Enable main core",
24 parser
.add_argument("--disable-core", dest
='core', action
="store_false",
25 help="disable main core",
27 parser
.add_argument("--enable-pll", dest
='pll', action
="store_true",
30 parser
.add_argument("--disable-pll", dest
='pll', action
="store_false",
33 parser
.add_argument("--enable-testgpio", action
="store_true",
34 help="Disable gpio pins",
36 parser
.add_argument("--debug", default
="jtag", help="Select debug " \
37 "interface [jtag | dmi] [default jtag]")
39 args
= parser
.parse_args()
44 'cr': 1, 'branch': 1, 'trap': 1,
52 pspec
= TestMemPspec(ldst_ifacetype
='bare_wb',
53 imem_ifacetype
='bare_wb',
58 # set to 32 for instruction-memory width=32
60 # set to 32 to make data wishbone bus 32-bit
62 xics
=args
.xics
, # XICS interrupt controller
63 nocore
=not args
.core
, # test coriolis2 ioring
64 use_pll
=args
.pll
, # bypass PLL
65 gpio
=args
.enable_testgpio
, # for test purposes
66 debug
=args
.debug
, # set to jtag or dmi
69 print("nocore", pspec
.__dict
__["nocore"])
70 print("gpio", pspec
.__dict
__["gpio"])
71 print("xics", pspec
.__dict
__["xics"])
72 print("use_pll", pspec
.__dict
__["use_pll"])
73 print("debug", pspec
.__dict
__["debug"])
75 dut
= TestIssuer(pspec
)
77 vl
= verilog
.convert(dut
, ports
=dut
.external_ports(), name
="test_issuer")
78 with
open(args
.output_filename
, "w") as f
: