Skip to content

Commit

Permalink
Improve GateMate support: pass Verilog defines and parameters and sea…
Browse files Browse the repository at this point in the history
…rch for p_r tool in PATH
  • Loading branch information
Anton Kuzmin authored and olofk committed Apr 23, 2024
1 parent 6114cbf commit 8143f90
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions edalize/gatemate.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def configure_main(self):
else:
ccf_file = f.name

# Pass trellis tool options to yosys
# Pass GateMate tool options to yosys
self.edam["tool_options"] = {
"yosys": {
"arch": "gatemate",
Expand All @@ -84,16 +84,27 @@ def configure_main(self):
}

yosys = Yosys(self.edam, self.work_root)
yosys.configure()

# Always define CCGM
yosys.vlogdefine["CCGM"] = 1

for k, v in self.tool_options.get("vlogdefine", []):
yosys.vlogdefine[k] = v

for k, v in self.tool_options.get("vlogparam", []):
yosys.vlogparam[k] = v

yosys.configure_main()

# Write Makefile
commands = EdaCommands()
commands.commands = yosys.commands

# PnR & image generation
commands.add_var("P_R := $(shell which p_r)")
targets = self.name + "_00.cfg.bit"
command = [
"p_r",
"$(P_R)",
"-A",
device_number,
"-i",
Expand Down

0 comments on commit 8143f90

Please sign in to comment.