Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: azonenberg/yosys
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1cca1563c64c
Choose a base ref
...
head repository: azonenberg/yosys
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3655d7fea7ce
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Oct 19, 2016

  1. Merge pull request YosysHQ#250 from azonenberg/master

    Add support for more GreenPak cells (edge detector, delay, pattern generator)
    cliffordwolf authored Oct 19, 2016
    Copy the full SHA
    0b3885b View commit details
  2. Copy the full SHA
    042b67f View commit details
  3. Added "setparam -type"

    cliffordwolf committed Oct 19, 2016
    Copy the full SHA
    3655d7f View commit details
Showing with 20 additions and 4 deletions.
  1. +7 −1 frontends/blif/blifparse.cc
  2. +13 −3 passes/cmds/setattr.cc
8 changes: 7 additions & 1 deletion frontends/blif/blifparse.cc
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ YOSYS_NAMESPACE_BEGIN

static bool read_next_line(char *&buffer, size_t &buffer_size, int &line_count, std::istream &f)
{
string strbuf;
int buffer_len = 0;
buffer[0] = 0;

@@ -42,8 +43,13 @@ static bool read_next_line(char *&buffer, size_t &buffer_size, int &line_count,
if (buffer_len > 0 && buffer[buffer_len-1] == '\\')
buffer[--buffer_len] = 0;
line_count++;
if (!f.getline(buffer+buffer_len, buffer_size-buffer_len))
if (!std::getline(f, strbuf))
return false;
while (buffer_size-buffer_len < strbuf.size()+1) {
buffer_size *= 2;
buffer = (char*)realloc(buffer, buffer_size);
}
strcpy(buffer+buffer_len, strbuf.c_str());
} else
return true;
}
16 changes: 13 additions & 3 deletions passes/cmds/setattr.cc
Original file line number Diff line number Diff line change
@@ -134,15 +134,18 @@ struct SetparamPass : public Pass {
{
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
log("\n");
log(" setparam [ -set name value | -unset name ]... [selection]\n");
log(" setparam [ -type cell_type ] [ -set name value | -unset name ]... [selection]\n");
log("\n");
log("Set/unset the given parameters on the selected cells. String values must be\n");
log("passed in double quotes (\").\n");
log("\n");
log("The -type option can be used to change the cell type of the selected cells.\n");
log("\n");
}
virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
{
std::vector<setunset_t> setunset_list;
vector<setunset_t> setunset_list;
string new_cell_type;

size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
@@ -158,6 +161,10 @@ struct SetparamPass : public Pass {
setunset_list.push_back(setunset_t(args[++argidx]));
continue;
}
if (arg == "-type" && argidx+1 < args.size()) {
new_cell_type = RTLIL::escape_id(args[++argidx]);
continue;
}
break;
}
extra_args(args, argidx, design);
@@ -170,8 +177,11 @@ struct SetparamPass : public Pass {
continue;

for (auto &it : module->cells_)
if (design->selected(module, it.second))
if (design->selected(module, it.second)) {
if (!new_cell_type.empty())
it.second->type = new_cell_type;
do_setunset(it.second->parameters, setunset_list);
}
}
}
} SetparamPass;