diff options
| -rw-r--r-- | ice40/bitstream.cc | 5 | ||||
| -rw-r--r-- | ice40/pack.cc | 3 | 
2 files changed, 4 insertions, 4 deletions
| diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc index fa8e444d..ba4a0e8d 100644 --- a/ice40/bitstream.cc +++ b/ice40/bitstream.cc @@ -382,14 +382,15 @@ void write_asc(const Design &design, std::ostream &out)                      std::string init = get_param_str_or_def(                              cell.second,                              std::string("INIT_") + get_hexdigit(w)); +                    assert(init != "");                      for (int i = 0; i < init.size(); i++) {                          bool val = (init.at((init.size() - 1) - i) == '1');                          bits.at(i) = val;                      } -                    for (int i = 0; i < bits.size(); i += 4) { +                    for (int i = bits.size()-4; i >= 0; i -= 4) {                          int c = bits.at(i) + (bits.at(i + 1) << 1) +                                  (bits.at(i + 2) << 2) + (bits.at(i + 3) << 3); -                        out << get_hexdigit(c); +                        out << char(std::tolower(get_hexdigit(c)));                      }                      out << std::endl;                  } diff --git a/ice40/pack.cc b/ice40/pack.cc index f4c024da..b9a9fe6d 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -129,8 +129,7 @@ static void pack_ram(Design *design)                                                 ci->name.str() + "_RAM");              packed_cells.insert(ci->name);              new_cells.push_back(packed); -            packed->params["READ_MODE"] = ci->params.at("READ_MODE"); -            packed->params["WRITE_MODE"] = ci->params.at("WRITE_MODE"); +            std::copy(ci->params.begin(), ci->params.end(), std::inserter(packed->params, packed->params.begin()));              packed->params["NEG_CLK_W"] =                      std::to_string(ci->type == "SB_RAM40_4KNW" ||                                     ci->type == "SB_RAM40_4KNRNW"); | 
