diff options
author | Olivier Galibert <galibert@pobox.com> | 2021-10-14 17:04:32 +0200 |
---|---|---|
committer | Olivier Galibert <galibert@pobox.com> | 2021-10-14 17:04:32 +0200 |
commit | 206bb0750608b65ff241f32bbf3e609ea307825a (patch) | |
tree | 79a56e531fa2b957559443a6438bb95687b82e94 /mistral | |
parent | 4e1f2d7deb07c3119dcd1814273e2eb273fc19ef (diff) | |
download | nextpnr-206bb0750608b65ff241f32bbf3e609ea307825a.tar.gz nextpnr-206bb0750608b65ff241f32bbf3e609ea307825a.tar.bz2 nextpnr-206bb0750608b65ff241f32bbf3e609ea307825a.zip |
mistral: Add support for cyclonev_hps_interface_mpu_general_purpose
Diffstat (limited to 'mistral')
-rw-r--r-- | mistral/arch.cc | 5 | ||||
-rw-r--r-- | mistral/arch.h | 1 | ||||
-rw-r--r-- | mistral/globals.cc | 9 |
3 files changed, 15 insertions, 0 deletions
diff --git a/mistral/arch.cc b/mistral/arch.cc index 8ac225d4..b91bba39 100644 --- a/mistral/arch.cc +++ b/mistral/arch.cc @@ -77,6 +77,11 @@ Arch::Arch(ArchArgs args) for (auto cmuxh_pos : cyclonev->cmuxh_get_pos()) create_clkbuf(CycloneV::pos2x(cmuxh_pos), CycloneV::pos2y(cmuxh_pos)); + auto hps_pos = cyclonev->hps_get_pos(); + if (!hps_pos.empty()) { + create_hps_mpu_general_purpose(CycloneV::pos2x(hps_pos[CycloneV::I_HPS_MPU_GENERAL_PURPOSE]), CycloneV::pos2y(hps_pos[CycloneV::I_HPS_MPU_GENERAL_PURPOSE])); + } + // This import takes about 5s, perhaps long term we can speed it up, e.g. defer to Mistral more... log_info("Initialising routing graph...\n"); int pip_count = 0; diff --git a/mistral/arch.h b/mistral/arch.h index 4f5e68ae..df6d7e75 100644 --- a/mistral/arch.h +++ b/mistral/arch.h @@ -469,6 +469,7 @@ struct Arch : BaseArch<ArchRanges> void create_lab(int x, int y, bool is_mlab); // lab.cc void create_gpio(int x, int y); // io.cc void create_clkbuf(int x, int y); // globals.cc + void create_hps_mpu_general_purpose(int x, int y); // globals.cc // ------------------------------------------------- diff --git a/mistral/globals.cc b/mistral/globals.cc index 3203893b..cf0f556c 100644 --- a/mistral/globals.cc +++ b/mistral/globals.cc @@ -43,4 +43,13 @@ bool Arch::is_clkbuf_cell(IdString cell_type) const return cell_type == id_MISTRAL_CLKENA || cell_type == id_MISTRAL_CLKBUF; } +void Arch::create_hps_mpu_general_purpose(int x, int y) +{ + BelId gp_bel = add_bel(x, y, id("cyclonev_hps_interface_mpu_general_purpose"), id("cyclonev_hps_interface_mpu_general_purpose")); + for (int i = 0; i < 32; i++) { + add_bel_pin(gp_bel, id(stringf("gp_in[%d]", i)), PORT_IN, get_port(CycloneV::HPS_MPU_GENERAL_PURPOSE, x, y, -1, CycloneV::GP_IN, i)); + add_bel_pin(gp_bel, id(stringf("gp_out[%d]", i)), PORT_OUT, get_port(CycloneV::HPS_MPU_GENERAL_PURPOSE, x, y, -1, CycloneV::GP_OUT, i)); + } +} + NEXTPNR_NAMESPACE_END |