Skip to content

Commit 7dcfafb

Browse files
committed
fix jinja2 generation of lattice nexus constraints for oxide toolchain
1 parent 6e00dc2 commit 7dcfafb

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

amaranth/vendor/lattice_nexus.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1+
# NXOSCA and NXPLL is part of LiteX. Modified for Amaranth Nexus Platform (Nate Slager <slagernate@gmail.com>)
2+
# Copyright (c) 2020 David Corrigan <davidcorrigan714@gmail.com>
3+
# SPDX-License-Identifier: BSD-2-Clause
4+
5+
16
from abc import abstractproperty
27

38
from ..hdl import *
49
from ..build import *
510

11+
from collections import namedtuple
12+
import logging
13+
import math
14+
import pprint
15+
from math import log, log10, exp, pi
16+
from cmath import phase
17+
18+
io_i2 = namedtuple('io_i2',['io', 'i2', 'IPP_CTRL', 'BW_CTL_BIAS', 'IPP_SEL'])
19+
nx_pll_param_permutation = namedtuple("nx_pll_param_permutation",[
20+
"C1","C2","C3","C4","C5","C6",
21+
"IPP_CTRL","BW_CTL_BIAS","IPP_SEL","CSET","CRIPPLE","V2I_PP_RES","IPI_CMP"])
622

723
__all__ = ["LatticeNexusPlatform"]
824

@@ -128,7 +144,7 @@ class LatticeNexusPlatform(TemplatedPlatform):
128144
{% for port_name, pin_name, attrs in platform.iter_port_constraints_bits() -%}
129145
ldc_set_location -site {{ '{' }}{{pin_name}}{{ '}' }} {{'['}}get_ports {{port_name}}{{']'}}
130146
{% if attrs -%}
131-
ldc_set_port -iobuf {{ '{' }}{%- for key, value in attrs.items() %}{{key}}={{value}}{% endfor %}{{ '}' }} {{'['}}get_ports {{port_name}}{{']'}}
147+
ldc_set_port -iobuf {{ '{' }}{%- for key, value in attrs.items() %}{{key}}={{value}} {% endfor %}{{ '}' }} {{'['}}get_ports {{port_name}}{{']'}}
132148
{% endif %}
133149
{% endfor %}
134150
{% for net_signal, port_signal, frequency in platform.iter_clock_constraints() -%}
@@ -322,6 +338,7 @@ def create_missing_domain(self, name):
322338
)
323339
else:
324340
clk_i = self.request(self.default_clk).i
341+
325342
if self.default_rst is not None:
326343
rst_i = self.request(self.default_rst).i
327344
else:
@@ -754,3 +771,4 @@ def get_diff_input_output(self, pin, port, attrs, invert):
754771

755772
# CDC primitives are not currently specialized for Nexus.
756773
# While Radiant supports false path constraints; nextpnr-nexus does not.
774+

0 commit comments

Comments
 (0)