Skip to content

Commit 5fd9c2a

Browse files
ArcaneNibbleazonenberg
authored andcommittedAug 30, 2017
Fix bug loading libraries when they are already loaded
1 parent 365fb30 commit 5fd9c2a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

Diff for: ‎passes/techmap/extract_tff.cc

+8-1
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,21 @@ struct ExtractTFFPass : public ScriptPass
4545
}
4646

4747
bool no_final_abc;
48+
bool already_loaded_lib;
4849

4950
virtual void clear_flags() YS_OVERRIDE
5051
{
5152
no_final_abc = false;
53+
already_loaded_lib = false;
5254
}
5355

5456
virtual void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
5557
{
5658
clear_flags();
5759

60+
if (design->has("\\__TFF_N_"))
61+
already_loaded_lib = true;
62+
5863
size_t argidx;
5964
for (argidx = 1; argidx < args.size(); argidx++)
6065
{
@@ -78,7 +83,9 @@ struct ExtractTFFPass : public ScriptPass
7883
{
7984
run("abc -g AND,XOR");
8085
run("extract -map +/untechmap/tff_untechmap.v");
81-
run("read_verilog -lib +/untechmap/tff_untechmap.v");
86+
// Load this library only if the design doesn't already have it
87+
if (!already_loaded_lib)
88+
run("read_verilog -lib +/untechmap/tff_untechmap.v");
8289

8390
if (!no_final_abc)
8491
run("abc");

0 commit comments

Comments
 (0)
Please sign in to comment.