aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs
diff options
context:
space:
mode:
authorDan Ravensloft <dan.ravensloft@gmail.com>2020-04-23 00:56:49 +0100
committerMarcelina Koƛcielnicka <mwk@0x04.net>2020-04-23 11:03:28 +0200
commit3d149aff733692b368919191dc31e731cbba9cfa (patch)
tree5735e2700211129d29c9b6fda4153942200b7b82 /techlibs
parentb700592881a2f2a87cca9776cd9bfca85781c9ec (diff)
downloadyosys-3d149aff733692b368919191dc31e731cbba9cfa.tar.gz
yosys-3d149aff733692b368919191dc31e731cbba9cfa.tar.bz2
yosys-3d149aff733692b368919191dc31e731cbba9cfa.zip
intel_alm: work around a Quartus ICE
Diffstat (limited to 'techlibs')
-rw-r--r--techlibs/intel_alm/synth_intel_alm.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/techlibs/intel_alm/synth_intel_alm.cc b/techlibs/intel_alm/synth_intel_alm.cc
index 47aa11500..5d4c78d74 100644
--- a/techlibs/intel_alm/synth_intel_alm.cc
+++ b/techlibs/intel_alm/synth_intel_alm.cc
@@ -200,6 +200,8 @@ struct SynthIntelALMPass : public ScriptPass {
if (check_label("map_ffs")) {
run("dff2dffe -direct-match $_DFF_*");
+ // As mentioned in common/dff_sim.v, Intel flops power up to zero,
+ // so use `zinit` to add inverters where needed.
run("zinit");
run("techmap -map +/techmap.v -map +/intel_alm/common/dff_map.v");
run("opt -full -undriven -mux_undef");
@@ -223,8 +225,16 @@ struct SynthIntelALMPass : public ScriptPass {
if (check_label("quartus")) {
if (quartus || help_mode) {
+ // Quartus ICEs if you have a wire which has `[]` in its name,
+ // which Yosys produces when building memories out of flops.
+ run("rename -hide w:*[* w:*]*");
+ // VQM mode does not support 'x, so replace those with zero.
run("setundef -zero");
+ // VQM mode does not support multi-bit constant assignments
+ // (e.g. 2'b00 is an error), so as a workaround use references
+ // to constant driver cells, which Quartus accepts.
run("hilomap -singleton -hicell __MISTRAL_VCC Q -locell __MISTRAL_GND Q");
+ // Rename from Yosys-internal MISTRAL_* cells to Quartus cells.
run("techmap -map +/intel_alm/common/quartus_rename.v");
run(stringf("techmap -map +/intel_alm/%s/quartus_rename.v", family_opt.c_str()));
}