diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2019-06-07 11:48:15 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2019-06-07 11:48:15 +0200 |
commit | 1093d7e1228272ca73114bbc4415c48d6cba76ed (patch) | |
tree | 13591f77267f0e77fff83593959c0d805c76b4e1 /ice40 | |
parent | 3ae50f85b15437b92b0ab3e6e9c243ea0556fdfc (diff) | |
download | nextpnr-1093d7e1228272ca73114bbc4415c48d6cba76ed.tar.gz nextpnr-1093d7e1228272ca73114bbc4415c48d6cba76ed.tar.bz2 nextpnr-1093d7e1228272ca73114bbc4415c48d6cba76ed.zip |
WIP saving/loading attributes
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/arch.cc | 24 | ||||
-rw-r--r-- | ice40/arch.h | 2 | ||||
-rw-r--r-- | ice40/pack.cc | 1 |
3 files changed, 23 insertions, 4 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc index d536ad35..659717f8 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -683,16 +683,21 @@ bool Arch::place() } else { log_error("iCE40 architecture does not support placer '%s'\n", placer.c_str()); } + bool retVal = true; if (bool_or_default(settings, id("opt_timing"), false)) { TimingOptCfg tocfg(getCtx()); tocfg.cellTypes.insert(id_ICESTORM_LC); - return timing_opt(getCtx(), tocfg); - } else { - return true; + retVal = timing_opt(getCtx(), tocfg); } + archInfoToAttributes(); + return retVal; } -bool Arch::route() { return router1(getCtx(), Router1Cfg(getCtx())); } +bool Arch::route() { + bool retVal = router1(getCtx(), Router1Cfg(getCtx())); + archInfoToAttributes(); + return retVal; +} // ----------------------------------------------------------------------- @@ -1229,6 +1234,17 @@ void Arch::assignCellInfo(CellInfo *cell) } } +void Arch::archInfoToAttributes() +{ + commonInfoToAttributes(); +} + +void Arch::attributesToArchInfo() +{ + attributesToCommonInfo(); + assignArchInfo(); +} + const std::string Arch::defaultPlacer = "sa"; const std::vector<std::string> Arch::availablePlacers = {"sa", diff --git a/ice40/arch.h b/ice40/arch.h index ea29f4f1..8b6942cb 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -878,6 +878,8 @@ struct Arch : BaseCtx // netlist modifications, and validity checks void assignArchInfo(); void assignCellInfo(CellInfo *cell); + void archInfoToAttributes(); + void attributesToArchInfo(); // ------------------------------------------------- BelPin getIOBSharingPLLPin(BelId pll, IdString pll_pin) const diff --git a/ice40/pack.cc b/ice40/pack.cc index 4cb76add..bc57e7d0 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -1406,6 +1406,7 @@ bool Arch::pack() ctx->assignArchInfo(); constrain_chains(ctx); ctx->assignArchInfo(); + archInfoToAttributes(); log_info("Checksum: 0x%08x\n", ctx->checksum()); return true; } catch (log_execution_error_exception) { |