aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2/cells.h
diff options
context:
space:
mode:
authorWilliam D. Jones <thor0505@comcast.net>2021-06-30 15:23:09 -0400
committerWilliam D. Jones <thor0505@comcast.net>2021-07-01 09:59:53 -0400
commit41d09f71871184aabbd7495a485e257fc0450d40 (patch)
treea57e46a0fcbcd4bb90551100fe32bbdbcecec0c0 /machxo2/cells.h
parente625876949795ea3c0bc9b3071cbb45451cc1a16 (diff)
downloadnextpnr-41d09f71871184aabbd7495a485e257fc0450d40.tar.gz
nextpnr-41d09f71871184aabbd7495a485e257fc0450d40.tar.bz2
nextpnr-41d09f71871184aabbd7495a485e257fc0450d40.zip
machxo2: Fix packing for directly-connected DFFs.
Diffstat (limited to 'machxo2/cells.h')
-rw-r--r--machxo2/cells.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/machxo2/cells.h b/machxo2/cells.h
index d26fdfa0..409b68b1 100644
--- a/machxo2/cells.h
+++ b/machxo2/cells.h
@@ -25,6 +25,16 @@
NEXTPNR_NAMESPACE_BEGIN
+// When packing DFFs, we need context of how it's connected to a LUT to
+// properly map DFF ports to FACADE_SLICEs; DI0 input muxes F0 and OFX0,
+// and a DFF inside a slice can use either DI0 or M0 as an input.
+enum class LutType
+{
+ None,
+ Normal,
+ PassThru,
+};
+
// Create a MachXO2 arch cell and return it
// Name will be automatically assigned if not specified
std::unique_ptr<CellInfo> create_machxo2_cell(Context *ctx, IdString type, std::string name = "");
@@ -46,7 +56,7 @@ void lut_to_lc(const Context *ctx, CellInfo *lut, CellInfo *lc, bool no_dff = tr
// and reconnecting signals as necessary. If pass_thru_lut is True, the LUT will
// be configured as pass through and D connected to I0, otherwise D will be
// ignored
-void dff_to_lc(Context *ctx, CellInfo *dff, CellInfo *lc, bool pass_thru_lut = false);
+void dff_to_lc(Context *ctx, CellInfo *dff, CellInfo *lc, LutType lut_type = LutType::Normal);
// Convert a nextpnr IO buffer to a GENERIC_IOB
void nxio_to_iob(Context *ctx, CellInfo *nxio, CellInfo *sbio, pool<IdString> &todelete_cells);