aboutsummaryrefslogtreecommitdiffstats
path: root/mistral
diff options
context:
space:
mode:
authorOlivier Galibert <galibert@pobox.com>2021-10-17 14:22:44 +0200
committerOlivier Galibert <galibert@pobox.com>2021-10-17 14:26:24 +0200
commitf88c119461065cd6e26602cb308dc138dda7c8b2 (patch)
tree93436fbd7953e52a45c8133899cc8e2fc34ae476 /mistral
parentc71a20e8052e82fb773138f9b935cd6f7371a0b1 (diff)
downloadnextpnr-f88c119461065cd6e26602cb308dc138dda7c8b2.tar.gz
nextpnr-f88c119461065cd6e26602cb308dc138dda7c8b2.tar.bz2
nextpnr-f88c119461065cd6e26602cb308dc138dda7c8b2.zip
mistral: Add internal oscillator support
Diffstat (limited to 'mistral')
-rw-r--r--mistral/arch.cc2
-rw-r--r--mistral/arch.h7
-rw-r--r--mistral/constids.inc1
-rw-r--r--mistral/globals.cc8
4 files changed, 15 insertions, 3 deletions
diff --git a/mistral/arch.cc b/mistral/arch.cc
index b91bba39..60456846 100644
--- a/mistral/arch.cc
+++ b/mistral/arch.cc
@@ -77,6 +77,8 @@ Arch::Arch(ArchArgs args)
for (auto cmuxh_pos : cyclonev->cmuxh_get_pos())
create_clkbuf(CycloneV::pos2x(cmuxh_pos), CycloneV::pos2y(cmuxh_pos));
+ create_control(CycloneV::pos2x(cyclonev->ctrl_get_pos()[0]), CycloneV::pos2y(cyclonev->ctrl_get_pos()[0]));
+
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]));
diff --git a/mistral/arch.h b/mistral/arch.h
index df6d7e75..34e55846 100644
--- a/mistral/arch.h
+++ b/mistral/arch.h
@@ -466,9 +466,10 @@ struct Arch : BaseArch<ArchRanges>
return WireId(cyclonev->pnode_to_rnode(CycloneV::pnode(bt, x, y, port, bi, pi)));
}
- 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_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_control(int x, int y); // globals.cc
void create_hps_mpu_general_purpose(int x, int y); // globals.cc
// -------------------------------------------------
diff --git a/mistral/constids.inc b/mistral/constids.inc
index 365f9977..2aa2c157 100644
--- a/mistral/constids.inc
+++ b/mistral/constids.inc
@@ -95,4 +95,5 @@ X(B1DATA)
X(WCLK_INV)
X(WE_INV)
+X(cyclonev_oscillator)
X(cyclonev_hps_interface_mpu_general_purpose)
diff --git a/mistral/globals.cc b/mistral/globals.cc
index 5b157a48..40d34155 100644
--- a/mistral/globals.cc
+++ b/mistral/globals.cc
@@ -52,4 +52,12 @@ void Arch::create_hps_mpu_general_purpose(int x, int y)
}
}
+void Arch::create_control(int x, int y)
+{
+ BelId oscillator_bel = add_bel(x, y, id_cyclonev_oscillator, id_cyclonev_oscillator);
+ add_bel_pin(oscillator_bel, id("oscena"), PORT_IN, get_port(CycloneV::CTRL, x, y, -1, CycloneV::OSC_ENA, -1));
+ add_bel_pin(oscillator_bel, id("clkout"), PORT_OUT, get_port(CycloneV::CTRL, x, y, -1, CycloneV::CLK_OUT, -1));
+ add_bel_pin(oscillator_bel, id("clkout1"), PORT_OUT, get_port(CycloneV::CTRL, x, y, -1, CycloneV::CLK_OUT1, -1));
+}
+
NEXTPNR_NAMESPACE_END