Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support variants for ECP5 #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 102 additions & 64 deletions devices.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,8 @@
"families": {
"ECP5": {
"devices": {
"LFE5U-12F": {
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x21111043",
"frames": 7562,
"bits_per_frame": 592,
"pad_bits_after_frame": 0,
"pad_bits_before_frame": 0,
"max_row" : 50,
"max_col" : 72,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
},
"LFE5U-25F": {
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x41111043",
"frames": 7562,
"bits_per_frame": 592,
"pad_bits_after_frame": 0,
Expand All @@ -26,11 +12,30 @@
"max_col" : 72,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
"fuzz": 1,
"variants": {
"LFE5U-25F": {
"idcode": "0x41111043",
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 6, 7, 8 ],
"suffixes": [ "C", "I" ]
},
"LFE5U-12F": {
"idcode": "0x21111043",
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 6, 7, 8 ],
"suffixes": [ "C", "I" ]
},
"LAE5U-12F": {
"idcode": "0x21111043",
"packages": ["caBGA381"],
"speeds": [ 6, 7 ],
"suffixes": [ "E" ]
}
}
},
"LFE5U-45F": {
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x41112043",
"frames": 9470,
"bits_per_frame": 846,
"pad_bits_after_frame": 0,
Expand All @@ -39,11 +44,18 @@
"max_col" : 90,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
"fuzz": 1,
"variants": {
"LFE5U-45F": {
"idcode": "0x41112043",
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 6, 7, 8 ],
"suffixes": [ "C", "I" ]
}
}
},
"LFE5U-85F": {
"packages": ["csfBGA285", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x41113043",
"frames": 13294,
"bits_per_frame": 1136,
"pad_bits_after_frame": 0,
Expand All @@ -52,11 +64,18 @@
"max_col" : 126,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
"fuzz": 1,
"variants": {
"LFE5U-85F": {
"idcode": "0x41113043",
"packages": ["csfBGA285", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 6, 7, 8 ],
"suffixes": [ "C", "I" ]
}
}
},
"LFE5UM-25F": {
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x01111043",
"frames": 7562,
"bits_per_frame": 592,
"pad_bits_after_frame": 0,
Expand All @@ -65,11 +84,30 @@
"max_col" : 72,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
"fuzz": 1,
"variants": {
"LFE5UM-25F": {
"idcode": "0x01111043",
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 6, 7, 8 ],
"suffixes": [ "C", "I" ]
},
"LAE5UM-25F": {
"idcode": "0x01111043",
"packages": ["csfBGA285", "caBGA381"],
"speeds": [ 6, 7 ],
"suffixes": [ "E" ]
},
"LFE5UM5G-25F": {
"idcode": "0x81111043",
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 8 ],
"suffixes": [ "C", "I" ]
}
}
},
"LFE5UM-45F": {
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x01112043",
"frames": 9470,
"bits_per_frame": 846,
"pad_bits_after_frame": 0,
Expand All @@ -78,50 +116,30 @@
"max_col" : 90,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
"fuzz": 1,
"variants": {
"LFE5UM-45F": {
"idcode": "0x01112043",
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 6, 7, 8 ],
"suffixes": [ "C", "I" ]
},
"LAE5UM-45F": {
"idcode": "0x01112043",
"packages": ["csfBGA285", "caBGA381"],
"speeds": [ 6, 7 ],
"suffixes": [ "E" ]
},
"LFE5UM5G-45F": {
"idcode": "0x81112043",
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 8 ],
"suffixes": [ "C", "I" ]
}
}
},
"LFE5UM-85F": {
"packages": ["csfBGA285", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x01113043",
"frames": 13294,
"bits_per_frame": 1136,
"pad_bits_after_frame": 0,
"pad_bits_before_frame": 0,
"max_row" : 95,
"max_col" : 126,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
},
"LFE5UM5G-25F": {
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x81111043",
"frames": 7562,
"bits_per_frame": 592,
"pad_bits_after_frame": 0,
"pad_bits_before_frame": 0,
"max_row" : 50,
"max_col" : 72,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
},
"LFE5UM5G-45F": {
"packages": ["csfBGA285", "caBGA256", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x81112043",
"frames": 9470,
"bits_per_frame": 846,
"pad_bits_after_frame": 0,
"pad_bits_before_frame": 2,
"max_row" : 71,
"max_col" : 90,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
},
"LFE5UM5G-85F": {
"packages": ["csfBGA285", "caBGA381", "caBGA554", "caBGA756"],
"idcode": "0x81113043",
"frames": 13294,
"bits_per_frame": 1136,
"pad_bits_after_frame": 0,
Expand All @@ -130,7 +148,27 @@
"max_col" : 126,
"row_bias" : 0,
"col_bias" : 0,
"fuzz": 1
"fuzz": 1,
"variants": {
"LFE5UM-85F": {
"idcode": "0x01113043",
"packages": ["csfBGA285", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 6, 7, 8 ],
"suffixes": [ "C", "I"]
},
"LAE5UM-85F": {
"idcode": "0x01113043",
"packages": ["caBGA756"],
"speeds": [ 6, 7 ],
"suffixes": [ "E" ]
},
"LFE5UM5G-85F": {
"idcode": "0x81113043",
"packages": ["csfBGA285", "caBGA381", "caBGA554", "caBGA756"],
"speeds": [ 8 ],
"suffixes": [ "C", "I" ]
}
}
}
}
},
Expand Down
3 changes: 1 addition & 2 deletions libtrellis/src/ChipConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ string ChipConfig::to_string() const
{
stringstream ss;
ss << ".device " << chip_name << endl << endl;
if (!chip_variant.empty())
ss << ".variant " << chip_variant << endl << endl;
ss << ".variant " << chip_variant << endl << endl;
for (const auto &meta : metadata)
ss << ".comment " << meta << endl;
for (const auto &sc : sysconfig)
Expand Down
16 changes: 14 additions & 2 deletions libtrellis/src/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,21 @@ DeviceLocator find_device_by_name(string name) {
return *found;
}

static string device_legacy_mapping(string variant)
{
if (variant == "LFE5U-12F") return "LFE5U-25F";
if (variant == "LFE5UM5G-25F") return "LFE5UM-25F";
if (variant == "LFE5UM5G-45F") return "LFE5UM-45F";
if (variant == "LFE5UM5G-85F") return "LFE5UM-85F";
return variant;
}

DeviceLocator find_device_by_name_and_variant(string name, string variant) {
if (variant.empty())
return find_device_by_name(name);
if (variant.empty()) {
fprintf(stderr, "warning: using old nexpnr with new trellis tools.\n");
variant = name;
name = device_legacy_mapping(variant);
}
auto found = find_device_generic([variant](const string &n, const pt::ptree &p) -> bool {
UNUSED(p);
return n == variant;
Expand Down
1 change: 1 addition & 0 deletions libtrellis/src/PyTrellis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ PYBIND11_MODULE (pytrellis, m)

class_<Chip>(m, "Chip")
.def(init<string>())
.def(init<string,string>())
.def(init<uint32_t>())
.def(init<const ChipInfo &>())
.def("get_tile_by_name", &Chip::get_tile_by_name)
Expand Down
88 changes: 0 additions & 88 deletions metadata/ECP5/LFE5U-12F/globals.json

This file was deleted.

Loading