diff --git a/f4pga/__init__.py b/f4pga/__init__.py index 91b4df2..fa63294 100755 --- a/f4pga/__init__.py +++ b/f4pga/__init__.py @@ -570,7 +570,10 @@ def get_platform_name_for_part(part_name: str): differ only in a type of package they use. """ with (Path(mypath) / 'part_db.json').open('r') as rfptr: - return json_load(rfptr).get(part_name.upper()) + for key, val in json_load(rfptr).items(): + if part_name.upper() in val: + return key + raise(Exception(f"Unknown part name <{part_name}>!")) def make_flow_config(project_flow_cfg: ProjectFlowConfig, part_name: str) -> FlowConfig: """ Create `FlowConfig` from given project flow configuration and part name """ diff --git a/f4pga/part_db.json b/f4pga/part_db.json index ff34555..072d51b 100644 --- a/f4pga/part_db.json +++ b/f4pga/part_db.json @@ -1,23 +1,34 @@ { - "XC7A50TCSG324-1": "xc7a50t", - "XC7A35TCSG324-1": "xc7a50t", - "XC7A35TCPG236-1": "xc7a50t", - "XC7A100TCSG324-1": "xc7a100t", - "XC7A100TFGG484-2": "xc7a100t", - "XC7A200TSBG484-1": "xc7a200t", - - "XC7C010CLG400-1": "xc7z010t", - - "EOS3FF512-PDN64": "ql-eos-s3", - "EOS3FF512-WRN42": "ql-eos-s3", - "EOS3FLF512-PDN64": "ql-eos-s3", - "EOS3FLF512-WRN42": "ql-eos-s3", - "EOS3CF512-PDN64": "ql-eos-s3", - "EOS3CF512-WRN42": "ql-eos-s3", - "EOS3CLF512-PDN64": "ql-eos-s3", - "EOS3CLF512-WRN42": "ql-eos-s3", - - "K4N8": "ql-k4n8_slow", - "K4N8_SLOW": "ql-k4n8_slow", - "K4N8_FAST": "ql-k4n8_fast" -} \ No newline at end of file + "xc7a50t": [ + "XC7A50TCSG324-1", + "XC7A35TCSG324-1", + "XC7A35TCPG236-1" + ], + "xc7a100t": [ + "XC7A100TCSG324-1", + "XC7A100TFGG484-2" + ], + "xc7a200t": [ + "XC7A200TSBG484-1" + ], + "xc7z010t": [ + "XC7C010CLG400-1" + ], + "ql-eos-s3": [ + "EOS3FF512-PDN64", + "EOS3FF512-WRN42", + "EOS3FLF512-PDN64", + "EOS3FLF512-WRN42", + "EOS3CF512-PDN64", + "EOS3CF512-WRN42", + "EOS3CLF512-PDN64", + "EOS3CLF512-WRN42" + ], + "ql-k4n8_slow": [ + "K4N8", + "K4N8_SLOW" + ], + "ql-k4n8_fast": [ + "K4N8_FAST" + ] +}