aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/arch.cc
diff options
context:
space:
mode:
authorYRabbit <rabbit@yrabbit.cyou>2021-08-31 07:53:15 +1000
committerYRabbit <rabbit@yrabbit.cyou>2021-08-31 07:53:15 +1000
commitf3899696a7d67ee0822efd6b00bef0e9b359c2f2 (patch)
tree1f7cef6d566777ff71da5b1ac169e6334ea3da8e /gowin/arch.cc
parent23a5e9185887758e7d5fd83fe49686aaa5783896 (diff)
downloadnextpnr-f3899696a7d67ee0822efd6b00bef0e9b359c2f2.tar.gz
nextpnr-f3899696a7d67ee0822efd6b00bef0e9b359c2f2.tar.bz2
nextpnr-f3899696a7d67ee0822efd6b00bef0e9b359c2f2.zip
gowin: Place DFFs of different types in the slice.
Allow the registers of the same type or pairs shown below to be placed in the same slide: |--------|--------| | DFFS | DFFR | | DFFSE | DFFRE | | DFFP | DFFC | | DFFPE | DFFCE | | DFFNS | DFFNR | | DFFNSE | DFFNRE | | DFFNP | DFFNC | | DFFNPE | DFFNCE | Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
Diffstat (limited to 'gowin/arch.cc')
-rw-r--r--gowin/arch.cc28
1 files changed, 26 insertions, 2 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc
index 813d52ed..022c93c3 100644
--- a/gowin/arch.cc
+++ b/gowin/arch.cc
@@ -804,6 +804,27 @@ Arch::Arch(ArchArgs args) : args(args)
}
}
}
+
+ // Permissible combinations of modes in a single slice
+ dff_comp_mode[id_DFF] = id_DFF;
+ dff_comp_mode[id_DFFE] = id_DFFE;
+ dff_comp_mode[id_DFFS] = id_DFFR;
+ dff_comp_mode[id_DFFR] = id_DFFS;
+ dff_comp_mode[id_DFFSE] = id_DFFRE;
+ dff_comp_mode[id_DFFRE] = id_DFFSE;
+ dff_comp_mode[id_DFFP] = id_DFFC;
+ dff_comp_mode[id_DFFC] = id_DFFP;
+ dff_comp_mode[id_DFFPE] = id_DFFCE;
+ dff_comp_mode[id_DFFCE] = id_DFFPE;
+ dff_comp_mode[id_DFFNS] = id_DFFNR;
+ dff_comp_mode[id_DFFNR] = id_DFFNS;
+ dff_comp_mode[id_DFFNSE] = id_DFFNRE;
+ dff_comp_mode[id_DFFNRE] = id_DFFNSE;
+ dff_comp_mode[id_DFFNP] = id_DFFNC;
+ dff_comp_mode[id_DFFNC] = id_DFFNP;
+ dff_comp_mode[id_DFFNPE] = id_DFFNCE;
+ dff_comp_mode[id_DFFNCE] = id_DFFNPE;
+
BaseArch::init_cell_types();
BaseArch::init_bel_buckets();
}
@@ -1251,8 +1272,11 @@ bool Arch::cellsCompatible(const CellInfo **cells, int count) const
return false;
if (mode[cls] == IdString())
mode[cls] = ci->ff_type;
- else if (mode[cls] != ci->ff_type)
- return false;
+ else if (mode[cls] != ci->ff_type) {
+ auto res = dff_comp_mode.find(mode[cls]);
+ if (res == dff_comp_mode.end() || res->second != ci->ff_type)
+ return false;
+ }
}
}
return true;