Merge pull request #849 from galibert/cyclonev-oscillator

mistral: Add internal oscillator support
This commit is contained in:
gatecat 2021-10-17 15:42:30 +01:00 committed by GitHub
commit 6bd1ab41b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 3 deletions

View File

@ -77,6 +77,8 @@ Arch::Arch(ArchArgs args)
for (auto cmuxh_pos : cyclonev->cmuxh_get_pos()) for (auto cmuxh_pos : cyclonev->cmuxh_get_pos())
create_clkbuf(CycloneV::pos2x(cmuxh_pos), CycloneV::pos2y(cmuxh_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(); auto hps_pos = cyclonev->hps_get_pos();
if (!hps_pos.empty()) { 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])); 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]));

View File

@ -469,6 +469,7 @@ struct Arch : BaseArch<ArchRanges>
void create_lab(int x, int y, bool is_mlab); // lab.cc void create_lab(int x, int y, bool is_mlab); // lab.cc
void create_gpio(int x, int y); // io.cc void create_gpio(int x, int y); // io.cc
void create_clkbuf(int x, int y); // globals.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 void create_hps_mpu_general_purpose(int x, int y); // globals.cc
// ------------------------------------------------- // -------------------------------------------------

View File

@ -95,4 +95,5 @@ X(B1DATA)
X(WCLK_INV) X(WCLK_INV)
X(WE_INV) X(WE_INV)
X(cyclonev_oscillator)
X(cyclonev_hps_interface_mpu_general_purpose) X(cyclonev_hps_interface_mpu_general_purpose)

View File

@ -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 NEXTPNR_NAMESPACE_END