File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,21 @@ DeviceLocator find_device_by_name(string name) {
6363 return *found;
6464}
6565
66+ static string device_legacy_mapping (string variant)
67+ {
68+ if (variant == " LFE5U-12F" ) return " LFE5U-25F" ;
69+ if (variant == " LFE5UM5G-25F" ) return " LFE5UM-25F" ;
70+ if (variant == " LFE5UM5G-45F" ) return " LFE5UM-45F" ;
71+ if (variant == " LFE5UM5G-85F" ) return " LFE5UM-85F" ;
72+ return variant;
73+ }
74+
6675DeviceLocator find_device_by_name_and_variant (string name, string variant) {
67- if (variant.empty ())
68- throw runtime_error (" using old nexpnr with new trellis tools. " );
76+ if (variant.empty ()) {
77+ fprintf (stderr, " warning: using old nexpnr with new trellis tools.\n " );
78+ variant = name;
79+ name = device_legacy_mapping (variant);
80+ }
6981 auto found = find_device_generic ([variant](const string &n, const pt::ptree &p) -> bool {
7082 UNUSED (p);
7183 return n == variant;
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ PYBIND11_MODULE (pytrellis, m)
156156
157157 class_<Chip>(m, " Chip" )
158158 .def (init<string>())
159+ .def (init<string,string>())
159160 .def (init<uint32_t >())
160161 .def (init<const ChipInfo &>())
161162 .def (" get_tile_by_name" , &Chip::get_tile_by_name)
You can’t perform that action at this time.
0 commit comments