Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/nmigen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1fcd495b0aed
Choose a base ref
...
head repository: m-labs/nmigen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 146f3cb68499
Choose a head ref
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on Jul 7, 2019

  1. build.plat: source a script with toolchain environment.

    Fixes #131.
    whitequark committed Jul 7, 2019
    Copy the full SHA
    146f3cb View commit details
Showing with 23 additions and 0 deletions.
  1. +3 −0 nmigen/build/plat.py
  2. +5 −0 nmigen/vendor/lattice_ecp5.py
  3. +5 −0 nmigen/vendor/lattice_ice40.py
  4. +5 −0 nmigen/vendor/xilinx_7series.py
  5. +5 −0 nmigen/vendor/xilinx_spartan6.py
3 changes: 3 additions & 0 deletions nmigen/build/plat.py
Original file line number Diff line number Diff line change
@@ -184,18 +184,21 @@ def get_diff_input_output(self, pin, p_port, n_port, attrs, invert):


class TemplatedPlatform(Platform):
toolchain = abstractproperty()
file_templates = abstractproperty()
command_templates = abstractproperty()

build_script_templates = {
"build_{{name}}.sh": """
# {{autogenerated}}
set -e{{verbose("x")}}
[ -n "$NMIGEN_{{platform.toolchain}}_env" ] && . "$NMIGEN_{{platform.toolchain}}_env"
{{emit_commands("sh")}}
""",
"build_{{name}}.bat": """
@rem {{autogenerated}}
{{quiet("@echo off")}}
if defined NMIGEN_{{platform.toolchain}}_env call %NMIGEN_{{platform.toolchain}}_env%
{{emit_commands("bat")}}
""",
}
5 changes: 5 additions & 0 deletions nmigen/vendor/lattice_ecp5.py
Original file line number Diff line number Diff line change
@@ -14,6 +14,9 @@ class LatticeECP5Platform(TemplatedPlatform):
* ``nextpnr-ecp5``
* ``ecppack``
The environment is populated by running the script specified in the environment variable
``NMIGEN_Trellis_env``, if present.
Available overrides:
* ``verbose``: enables logging of informational messages to standard error.
* ``read_verilog_opts``: adds options for ``read_verilog`` Yosys command.
@@ -33,6 +36,8 @@ class LatticeECP5Platform(TemplatedPlatform):
* ``{{name}}.svf``: JTAG programming vector.
"""

toolchain = "Trellis"

device = abstractproperty()
package = abstractproperty()
speed = abstractproperty()
5 changes: 5 additions & 0 deletions nmigen/vendor/lattice_ice40.py
Original file line number Diff line number Diff line change
@@ -14,6 +14,9 @@ class LatticeICE40Platform(TemplatedPlatform):
* ``nextpnr-ice40``
* ``icepack``
The environment is populated by running the script specified in the environment variable
``NMIGEN_IceStorm_env``, if present.
Available overrides:
* ``verbose``: enables logging of informational messages to standard error.
* ``read_verilog_opts``: adds options for ``read_verilog`` Yosys command.
@@ -32,6 +35,8 @@ class LatticeICE40Platform(TemplatedPlatform):
* ``{{name}}.bin``: binary bitstream.
"""

toolchain = "IceStorm"

device = abstractproperty()
package = abstractproperty()

5 changes: 5 additions & 0 deletions nmigen/vendor/xilinx_7series.py
Original file line number Diff line number Diff line change
@@ -14,6 +14,9 @@ class Xilinx7SeriesPlatform(TemplatedPlatform):
Required tools:
* ``vivado``
The environment is populated by running the script specified in the environment variable
``NMIGEN_Vivado_env``, if present.
Available overrides:
* ``script_after_read``: inserts commands after ``read_xdc`` in Tcl script.
* ``script_after_synth``: inserts commands after ``synth_design`` in Tcl script.
@@ -42,6 +45,8 @@ class Xilinx7SeriesPlatform(TemplatedPlatform):
* ``{{name}}.bit``: binary bitstream.
"""

toolchain = "Vivado"

device = abstractproperty()
package = abstractproperty()
speed = abstractproperty()
5 changes: 5 additions & 0 deletions nmigen/vendor/xilinx_spartan6.py
Original file line number Diff line number Diff line change
@@ -19,6 +19,9 @@ class XilinxSpartan6Platform(TemplatedPlatform):
* ``par``
* ``bitgen``
The environment is populated by running the script specified in the environment variable
``NMIGEN_ISE_env``, if present.
Available overrides:
* ``script_after_run``: inserts commands after ``run`` in XST script.
* ``add_constraints``: inserts commands in UCF file.
@@ -45,6 +48,8 @@ class XilinxSpartan6Platform(TemplatedPlatform):
* ``{{name}}.bit``: binary bitstream.
"""

toolchain = "ISE"

device = abstractproperty()
package = abstractproperty()
speed = abstractproperty()