aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/chipdb.h
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-04-23 11:50:26 +0100
committergatecat <gatecat@ds0.me>2021-05-21 10:00:35 +0100
commit237b27e50b66a4ebe30bd94aadcd52c068b0ade8 (patch)
treebe59da2c5f1b2f5fbd2b3e4924e1149ab8591d40 /fpga_interchange/chipdb.h
parent012b60c9cac4a5306b7a48a4cf6fe286ffb754ee (diff)
downloadnextpnr-237b27e50b66a4ebe30bd94aadcd52c068b0ade8.tar.gz
nextpnr-237b27e50b66a4ebe30bd94aadcd52c068b0ade8.tar.bz2
nextpnr-237b27e50b66a4ebe30bd94aadcd52c068b0ade8.zip
interchange: Add macro param map rules to chipdb
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'fpga_interchange/chipdb.h')
-rw-r--r--fpga_interchange/chipdb.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/fpga_interchange/chipdb.h b/fpga_interchange/chipdb.h
index 3565b534..155c2bb2 100644
--- a/fpga_interchange/chipdb.h
+++ b/fpga_interchange/chipdb.h
@@ -337,6 +337,28 @@ NPNR_PACKED_STRUCT(struct MacroParameterPOD {
int32_t value; // constid
});
+enum MacroParamRuleType
+{
+ PARAM_MAP_COPY = 0, // copy parameter value
+ PARAM_MAP_SLICE = 1, // take a slice of bits
+ PARAM_MAP_TABLE = 2, // lookup strings in table
+};
+
+NPNR_PACKED_STRUCT(struct MacroParamMapRulePOD {
+ // name of parameter on parent primitive
+ int32_t prim_param; // constid
+ // name of instance to set parameter on
+ int32_t inst_name; // constid
+ // name of parameter on macro expansion instance
+ int32_t inst_param; // constid
+ // type of mapping to use to derive new value
+ int32_t rule_type; // MacroParamRuleType
+ // for slice mappings, the bits to collect
+ RelSlice<uint32_t> slice_bits;
+ // for table mappings, the lookup table to use
+ RelSlice<MacroParameterPOD> map_table;
+});
+
NPNR_PACKED_STRUCT(struct MacroCellInstPOD {
int32_t name; // instance name constid
int32_t type; // instance type constid
@@ -376,6 +398,8 @@ NPNR_PACKED_STRUCT(struct MacroExpansionPOD {
int32_t macro_name;
// list of parameters to (optionally) match
RelSlice<MacroParameterPOD> param_matches;
+ // how to derive parameters for expansion instances
+ RelSlice<MacroParamMapRulePOD> param_rules;
});
NPNR_PACKED_STRUCT(struct ChipInfoPOD {