aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-10-13 20:18:46 +0100
committerGitHub <noreply@github.com>2019-10-13 20:18:46 +0100
commitc365dd1cabc3a4308ab9110534918623622c246b (patch)
treea9b85e3fe416a3415229845b6c9d099aa513c136 /ice40
parentee769420e3594c45a5f531a71b136125e5cb883c (diff)
parent8c0610e84fa6a38d3f351774bd81a32c96a91242 (diff)
downloadnextpnr-c365dd1cabc3a4308ab9110534918623622c246b.tar.gz
nextpnr-c365dd1cabc3a4308ab9110534918623622c246b.tar.bz2
nextpnr-c365dd1cabc3a4308ab9110534918623622c246b.zip
Merge pull request #341 from YosysHQ/dave/ice40-pcf-frequency
ice40: Add set_frequency pcf command; and document pcf format
Diffstat (limited to 'ice40')
-rw-r--r--ice40/pcf.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/ice40/pcf.cc b/ice40/pcf.cc
index 8c61eb23..526b3d64 100644
--- a/ice40/pcf.cc
+++ b/ice40/pcf.cc
@@ -100,6 +100,10 @@ bool apply_pcf(Context *ctx, std::string filename, std::istream &in)
for (const auto &attr : extra_attrs)
fnd_cell->second->attrs[attr.first] = attr.second;
}
+ } else if (cmd == "set_frequency") {
+ if (words.size() < 3)
+ log_error("expected PCF syntax 'set_frequency net frequency' (on line %d)\n", lineno);
+ ctx->addClock(ctx->id(words.at(1)), std::stof(words.at(2)));
} else {
log_error("unsupported PCF command '%s' (on line %d)\n", cmd.c_str(), lineno);
}