4 # list Verilog sources before changing directory
7 root
= os
.path
.join("verilog", d
)
8 files
= os
.listdir(root
)
11 verilog_sources
.append(os
.path
.join(root
, f
))
12 def add_core_files(d
, files
):
14 verilog_sources
.append(os
.path
.join("verilog", d
, f
))
15 add_core_dir("generic")
17 add_core_dir("s6ddrphy")
18 add_core_files("lm32", ["lm32_cpu.v", "lm32_instruction_unit.v", "lm32_decoder.v",
19 "lm32_load_store_unit.v", "lm32_adder.v", "lm32_addsub.v", "lm32_logic_op.v",
20 "lm32_shifter.v", "lm32_multiplier_spartan6.v", "lm32_mc_arithmetic.v",
21 "lm32_interrupt.v", "lm32_ram.v", "lm32_dp_ram.v", "lm32_icache.v",
22 "lm32_dcache.v", "lm32_top.v", "lm32_debug.v", "lm32_jtag.v", "jtag_cores.v",
23 "jtag_tap_spartan6.v"])
24 add_core_dir("minimac3")
28 def str2file(filename
, contents
):
29 f
= open(filename
, "w")
34 (src_verilog
, src_ucf
) = top
.get()
35 str2file("soc.v", src_verilog
)
36 str2file("soc.ucf", src_ucf
)
37 verilog_sources
.append("build/soc.v")
39 # generate XST project file
41 for s
in verilog_sources
:
42 xst_prj
+= "verilog work ../" + s
+ "\n"
43 str2file("soc.prj", xst_prj
)