Merge pull request #953 from YosysHQ/gatecat/mistral-updates

mistral: Update to latest upstream
This commit is contained in:
gatecat 2022-03-18 17:52:47 +00:00 committed by GitHub
commit 051228c49a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 12 deletions

View File

@ -21,7 +21,7 @@ jobs:
- name: Execute build nextpnr - name: Execute build nextpnr
env: env:
MISTRAL_PATH: ${{ github.workspace }}/deps/mistral MISTRAL_PATH: ${{ github.workspace }}/deps/mistral
MISTRAL_REVISION: 0c2ab2b2c6af33fea1c20349be2e0068366ed615 MISTRAL_REVISION: 6b0ce163d87200d0d5b7f330349aacf886f0f8be
run: | run: |
source ./.github/ci/build_mistral.sh source ./.github/ci/build_mistral.sh
get_dependencies get_dependencies

View File

@ -210,7 +210,8 @@ struct MistralBitgen
if (is_lutram) { if (is_lutram) {
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
// Many MLAB settings apply to the whole LAB, not just the ALM // Many MLAB settings apply to the whole LAB, not just the ALM
cv->bmux_m_set(block_type, pos, CycloneV::MODE, i, CycloneV::RAM); cv->bmux_m_set(block_type, pos, CycloneV::TMODE, i, CycloneV::RAM);
cv->bmux_m_set(block_type, pos, CycloneV::BMODE, i, CycloneV::RAM);
cv->bmux_n_set(block_type, pos, CycloneV::T_FEEDBACK_SEL, i, 1); cv->bmux_n_set(block_type, pos, CycloneV::T_FEEDBACK_SEL, i, 1);
} }
cv->bmux_r_set(block_type, pos, CycloneV::LUT_MASK, alm, 0xFFFFFFFFFFFFFFFFULL); // TODO: LUTRAM init cv->bmux_r_set(block_type, pos, CycloneV::LUT_MASK, alm, 0xFFFFFFFFFFFFFFFFULL); // TODO: LUTRAM init
@ -222,11 +223,11 @@ struct MistralBitgen
cv->bmux_n_set(block_type, pos, CycloneV::WRITE_PULSE_LENGTH, 0, 650); // picoseconds, presumably cv->bmux_n_set(block_type, pos, CycloneV::WRITE_PULSE_LENGTH, 0, 650); // picoseconds, presumably
// TODO: understand how these enables really work // TODO: understand how these enables really work
cv->bmux_b_set(block_type, pos, CycloneV::EN2_EN, 0, false); cv->bmux_b_set(block_type, pos, CycloneV::EN2_EN, 0, false);
cv->bmux_b_set(block_type, pos, CycloneV::EN_SCLK_LOAD_WHAT, 0, true); cv->bmux_b_set(block_type, pos, CycloneV::SCLR_DIS, 0, true);
cv->bmux_m_set(block_type, pos, CycloneV::SCLR_MUX, 0, CycloneV::GIN2);
} else { } else {
// Combinational mode - TODO: flop feedback // Combinational mode - TODO: flop feedback and more modes...
cv->bmux_m_set(block_type, pos, CycloneV::MODE, alm, alm_data.l6_mode ? CycloneV::L6 : CycloneV::L5); cv->bmux_m_set(block_type, pos, CycloneV::TMODE, alm, alm_data.l6_mode ? CycloneV::C_E : CycloneV::E_0);
cv->bmux_m_set(block_type, pos, CycloneV::BMODE, alm, alm_data.l6_mode ? CycloneV::D_E : CycloneV::E_1);
// LUT function // LUT function
cv->bmux_r_set(block_type, pos, CycloneV::LUT_MASK, alm, ctx->compute_lut_mask(lab, alm)); cv->bmux_r_set(block_type, pos, CycloneV::LUT_MASK, alm, ctx->compute_lut_mask(lab, alm));
} }
@ -300,12 +301,17 @@ struct MistralBitgen
// SCLR // SCLR
if (ff->ffInfo.ctrlset.sclr.net != nullptr) { if (ff->ffInfo.ctrlset.sclr.net != nullptr) {
cv->bmux_b_set(block_type, pos, CycloneV::SCLR_INV, 0, ff->ffInfo.ctrlset.sclr.inverted); cv->bmux_b_set(block_type, pos, CycloneV::SCLR_INV, 0, ff->ffInfo.ctrlset.sclr.inverted);
cv->bmux_b_set(block_type, pos, CycloneV::SCLR_DIS, 0, false);
} else { } else {
cv->bmux_b_set(block_type, pos, sclr_dis[i / 2], alm, true); cv->bmux_b_set(block_type, pos, sclr_dis[i / 2], alm, true);
} }
// SLOAD // SLOAD
if (ff->ffInfo.ctrlset.sload.net != nullptr) { if (ff->ffInfo.ctrlset.sload.net != nullptr) {
cv->bmux_b_set(block_type, pos, sload_en[i / 2], alm, true); cv->bmux_b_set(block_type, pos, sload_en[i / 2], alm, true);
if (ff->ffInfo.ctrlset.sload.net->name == ctx->id("$PACKER_GND_NET")) {
// force-disabled LOAD (see workaround in assign_ff_info)
cv->bmux_b_set(block_type, pos, CycloneV::SLOAD_EN, 0, false);
}
cv->bmux_b_set(block_type, pos, CycloneV::SLOAD_INV, 0, ff->ffInfo.ctrlset.sload.inverted); cv->bmux_b_set(block_type, pos, CycloneV::SLOAD_INV, 0, ff->ffInfo.ctrlset.sload.inverted);
} }
} }
@ -340,18 +346,18 @@ struct MistralBitgen
const std::array<CycloneV::bmux_type_t, 2> aclr_inp{CycloneV::ACLR0_SEL, CycloneV::ACLR1_SEL}; const std::array<CycloneV::bmux_type_t, 2> aclr_inp{CycloneV::ACLR0_SEL, CycloneV::ACLR1_SEL};
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
// Quartus seems to set unused ACLRs to CLKI2... // Quartus seems to set unused ACLRs to ACLR0
if (!lab_data.aclr_used[i]) if (lab_data.aclr_used[i])
cv->bmux_m_set(block_type, pos, aclr_inp[i], 0, CycloneV::CLKI2); cv->bmux_m_set(block_type, pos, aclr_inp[i], 0, (i == 1) ? CycloneV::DIN2 : CycloneV::DIN3);
else else if (i == 0)
cv->bmux_m_set(block_type, pos, aclr_inp[i], 0, (i == 1) ? CycloneV::GIN0 : CycloneV::GIN1); cv->bmux_m_set(block_type, pos, aclr_inp[i], 0, CycloneV::ACLR0);
} }
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
// Check for fabric->clock routing // Check for fabric->clock routing
if (ctx->wires_connected( if (ctx->wires_connected(
ctx->get_port(block_type, CycloneV::pos2x(pos), CycloneV::pos2y(pos), -1, CycloneV::DATAIN, 0), ctx->get_port(block_type, CycloneV::pos2x(pos), CycloneV::pos2y(pos), -1, CycloneV::DATAIN, 0),
lab_data.clk_wires[i])) lab_data.clk_wires[i]))
cv->bmux_m_set(block_type, pos, CycloneV::CLKA_SEL, 0, CycloneV::GIN2); cv->bmux_m_set(block_type, pos, CycloneV::CLKA_SEL, 0, CycloneV::DIN0);
} }
} }