diff options
author | gatecat <gatecat@ds0.me> | 2021-05-03 20:37:59 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-05-15 14:54:33 +0100 |
commit | 1cd22b81daa4c87870f65dedef74dba02adac8fe (patch) | |
tree | 36158dc8ec5c7957b41329cf689e942a795b1a92 /cyclonev/archdefs.h | |
parent | 9bd7ef5f5fcb77e36a988b0967a59965cfe55192 (diff) | |
download | nextpnr-1cd22b81daa4c87870f65dedef74dba02adac8fe.tar.gz nextpnr-1cd22b81daa4c87870f65dedef74dba02adac8fe.tar.bz2 nextpnr-1cd22b81daa4c87870f65dedef74dba02adac8fe.zip |
cyclonev: More preparations for validity checking
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'cyclonev/archdefs.h')
-rw-r--r-- | cyclonev/archdefs.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/cyclonev/archdefs.h b/cyclonev/archdefs.h index d6555887..5afdd783 100644 --- a/cyclonev/archdefs.h +++ b/cyclonev/archdefs.h @@ -134,6 +134,28 @@ struct ArchPinInfo struct NetInfo; +// Structures for representing how FF control sets are stored and validity-checked +struct ControlSig +{ + const NetInfo *net; + bool inverted; + + bool connected() const { return net != nullptr; } + bool operator==(const ControlSig &other) const { return net == other.net && inverted == other.inverted; } + bool operator!=(const ControlSig &other) const { return net == other.net && inverted == other.inverted; } +}; + +struct FFControlSet +{ + ControlSig clk, ena, aclr, sclr, sload; + + bool operator==(const FFControlSet &other) const + { + return clk == other.clk && ena == other.ena && aclr == other.aclr && sclr == other.sclr && sload == other.sload; + } + bool operator!=(const FFControlSet &other) const { return !(*this == other); } +}; + struct ArchCellInfo { union @@ -141,7 +163,7 @@ struct ArchCellInfo struct { // Store the nets here for fast validity checking (avoids too many map lookups in a hot path) - std::array<const NetInfo *, 7> input_sigs; + std::array<const NetInfo *, 7> lut_in; const NetInfo *comb_out; int lut_input_count; @@ -151,8 +173,8 @@ struct ArchCellInfo } combInfo; struct { - const NetInfo *clk, *ena, *aclr, *sclr, *sload, *sdata, *datain; - bool clk_inv, ena_inv, aclr_inv, sclr_inv, sload_inv; + FFControlSet ctrlset; + const NetInfo *sdata, *datain; } ffInfo; }; |