aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/mistral_ci.yml2
-rw-r--r--common/router2.cc3
-rw-r--r--gowin/pack.cc3
-rw-r--r--gui/mistral/family.cmake2
-rw-r--r--mistral/family.cmake2
-rw-r--r--mistral/io.cc4
-rw-r--r--nexus/main.cc3
-rw-r--r--nexus/pack.cc26
8 files changed, 24 insertions, 21 deletions
diff --git a/.github/workflows/mistral_ci.yml b/.github/workflows/mistral_ci.yml
index 96900543..7cf71621 100644
--- a/.github/workflows/mistral_ci.yml
+++ b/.github/workflows/mistral_ci.yml
@@ -21,7 +21,7 @@ jobs:
- name: Execute build nextpnr
env:
MISTRAL_PATH: ${{ github.workspace }}/deps/mistral
- MISTRAL_REVISION: ea9691a720cc5695eab2fc580172be5c9e592760
+ MISTRAL_REVISION: 0edeca112dda9bd463125feb869ddb7511d1acd9
run: |
source ./.github/ci/build_mistral.sh
get_dependencies
diff --git a/common/router2.cc b/common/router2.cc
index b93e7b35..051aa7f8 100644
--- a/common/router2.cc
+++ b/common/router2.cc
@@ -464,6 +464,9 @@ struct Router2
if (ctx->debug)
log(" %s\n", ctx->nameOfWire(cursor));
did_something |= (wd.reserved_net != net->udata);
+ if (wd.reserved_net != -1 && wd.reserved_net != net->udata)
+ log_error("attempting to reserve wire '%s' for nets '%s' and '%s'\n", ctx->nameOfWire(cursor),
+ ctx->nameOf(nets_by_udata.at(wd.reserved_net)), ctx->nameOf(net));
wd.reserved_net = net->udata;
if (cursor == src)
break;
diff --git a/gowin/pack.cc b/gowin/pack.cc
index 2616a913..4c6e28ca 100644
--- a/gowin/pack.cc
+++ b/gowin/pack.cc
@@ -89,6 +89,9 @@ static void pack_alus(Context *ctx)
}
std::unique_ptr<CellInfo> packed_head = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_HEAD_ALULC");
+ // Head is always SLICE0
+ packed_head->constr_z = 0;
+ packed_head->constr_abs_z = true;
if (ctx->verbose) {
log_info("packed ALU head into %s. CIN net is %s\n", ctx->nameOf(packed_head.get()),
ctx->nameOf(cin_netId));
diff --git a/gui/mistral/family.cmake b/gui/mistral/family.cmake
index c78ff6c1..072fa5cd 100644
--- a/gui/mistral/family.cmake
+++ b/gui/mistral/family.cmake
@@ -1 +1 @@
-target_include_directories(gui_mistral PRIVATE ${MISTRAL_ROOT}/libmistral ${CMAKE_BINARY_DIR}/libmistral)
+target_include_directories(gui_mistral PRIVATE ${MISTRAL_ROOT}/libmistral ${CMAKE_BINARY_DIR}/libmistral ${CMAKE_BINARY_DIR}/tools)
diff --git a/mistral/family.cmake b/mistral/family.cmake
index d2da396a..dcbab4ff 100644
--- a/mistral/family.cmake
+++ b/mistral/family.cmake
@@ -8,6 +8,6 @@ add_subdirectory(${MISTRAL_ROOT}/libmistral ${CMAKE_CURRENT_BINARY_DIR}/libmistr
find_package(LibLZMA REQUIRED)
foreach(family_target ${family_targets})
- target_include_directories(${family_target} PRIVATE ${MISTRAL_ROOT}/libmistral ${CMAKE_CURRENT_BINARY_DIR}/libmistral ${LIBLZMA_INCLUDE_DIRS})
+ target_include_directories(${family_target} PRIVATE ${MISTRAL_ROOT}/libmistral ${CMAKE_CURRENT_BINARY_DIR}/tools ${CMAKE_CURRENT_BINARY_DIR}/libmistral ${LIBLZMA_INCLUDE_DIRS})
target_link_libraries(${family_target} PRIVATE mistral ${LIBLZMA_LIBRARIES})
endforeach()
diff --git a/mistral/io.cc b/mistral/io.cc
index 3a72b001..dab3672e 100644
--- a/mistral/io.cc
+++ b/mistral/io.cc
@@ -31,9 +31,9 @@ void Arch::create_gpio(int x, int y)
BelId bel = add_bel(x, y, id(stringf("IO[%d]", z)), id_MISTRAL_IO);
add_bel_pin(bel, id_PAD, PORT_INOUT, pad);
// FIXME: is the port index of zero always correct?
- add_bel_pin(bel, id_I, PORT_IN, get_port(CycloneV::GPIO, x, y, z, CycloneV::DATAIN, 0));
+ add_bel_pin(bel, id_I, PORT_IN, get_port(CycloneV::GPIO, x, y, z, CycloneV::DATAOUT, 0));
add_bel_pin(bel, id_OE, PORT_IN, get_port(CycloneV::GPIO, x, y, z, CycloneV::OEIN, 0));
- add_bel_pin(bel, id_O, PORT_OUT, get_port(CycloneV::GPIO, x, y, z, CycloneV::DATAOUT, 0));
+ add_bel_pin(bel, id_O, PORT_OUT, get_port(CycloneV::GPIO, x, y, z, CycloneV::DATAIN, 0));
bel_data(bel).block_index = z;
}
}
diff --git a/nexus/main.cc b/nexus/main.cc
index 667b6d80..9fec8d5e 100644
--- a/nexus/main.cc
+++ b/nexus/main.cc
@@ -52,7 +52,8 @@ po::options_description NexusCommandHandler::getArchOptions()
specific.add_options()("pdc", po::value<std::string>(), "physical constraints file");
specific.add_options()("no-post-place-opt", "disable post-place repacking (debugging use only)");
specific.add_options()("no-pack-lutff", "disable packing (clustering) LUTs and FFs together");
- specific.add_options()("carry-lutff-ratio", po::value<float>(), "ratio of FFs to be added to carry-chain LUT clusters");
+ specific.add_options()("carry-lutff-ratio", po::value<float>(),
+ "ratio of FFs to be added to carry-chain LUT clusters");
return specific;
}
diff --git a/nexus/pack.cc b/nexus/pack.cc
index 0c771e82..c3d9cba2 100644
--- a/nexus/pack.cc
+++ b/nexus/pack.cc
@@ -2304,7 +2304,8 @@ struct NexusPacker
}
}
- FFControlSet gather_ff_settings(CellInfo* cell) {
+ FFControlSet gather_ff_settings(CellInfo *cell)
+ {
NPNR_ASSERT(cell->type == id_OXIDE_FF);
FFControlSet ctrlset;
@@ -2321,7 +2322,8 @@ struct NexusPacker
return ctrlset;
}
- void pack_lutffs () {
+ void pack_lutffs()
+ {
log_info("Inferring LUT+FF pairs...\n");
float carry_ratio = 1.0f;
@@ -2336,7 +2338,7 @@ struct NexusPacker
dict<IdString, FFControlSet> cluster_ffinfo;
size_t num_comb = 0;
- size_t num_ff = 0;
+ size_t num_ff = 0;
size_t num_pair = 0;
size_t num_glue = 0;
@@ -2361,13 +2363,11 @@ struct NexusPacker
}
// Check if the driver is a LUT and the direct connection is from F
- CellInfo* lut = di->driver.cell;
+ CellInfo *lut = di->driver.cell;
if (lut->type != id_OXIDE_COMB) {
continue;
}
- if (di->driver.port != id_F &&
- di->driver.port != id_OFX)
- {
+ if (di->driver.port != id_F && di->driver.port != id_OFX) {
continue;
}
@@ -2422,7 +2422,7 @@ struct NexusPacker
// No order not to make too large carry clusters pack only the
// given fraction of FFs there.
- if(str_or_default(lut->params, id_MODE, "LOGIC") == "CCU2") {
+ if (str_or_default(lut->params, id_MODE, "LOGIC") == "CCU2") {
float r = (float)(ctx->rng() % 1000) * 1e-3f;
if (r > carry_ratio) {
continue;
@@ -2430,7 +2430,7 @@ struct NexusPacker
}
// Get the cluster root
- CellInfo* root = ctx->cells.at(lut->cluster).get();
+ CellInfo *root = ctx->cells.at(lut->cluster).get();
// Constrain the FF relative to the LUT
ff->cluster = root->cluster;
@@ -2462,12 +2462,8 @@ struct NexusPacker
}
// Print statistics
- log_info(" Created %zu LUT+FF pairs and extended %zu clusters using total %zu FFs and %zu LUTs\n",
- num_pair,
- num_glue,
- num_ff,
- num_comb
- );
+ log_info(" Created %zu LUT+FF pairs and extended %zu clusters using total %zu FFs and %zu LUTs\n", num_pair,
+ num_glue, num_ff, num_comb);
}
explicit NexusPacker(Context *ctx) : ctx(ctx) {}