diff options
author | Ahmed Irfan <irfan@ubuntu.(none)> | 2014-01-16 20:16:01 +0100 |
---|---|---|
committer | Ahmed Irfan <irfan@ubuntu.(none)> | 2014-01-16 20:16:01 +0100 |
commit | c7a2e582aac966034d59def611bd53109ecb581e (patch) | |
tree | 65db8beffd668aeda8e61571e5d25f68448065b4 /backends/btor/btor.cc | |
parent | 3a1490888d05ac49d82aebad9ec6979aae32a8b0 (diff) | |
download | yosys-c7a2e582aac966034d59def611bd53109ecb581e.tar.gz yosys-c7a2e582aac966034d59def611bd53109ecb581e.tar.bz2 yosys-c7a2e582aac966034d59def611bd53109ecb581e.zip |
slice error corrected
Diffstat (limited to 'backends/btor/btor.cc')
-rw-r--r-- | backends/btor/btor.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/backends/btor/btor.cc b/backends/btor/btor.cc index fcb6a47aa..6ef9c3fc1 100644 --- a/backends/btor/btor.cc +++ b/backends/btor/btor.cc @@ -172,9 +172,10 @@ struct BtorDumper else { int prev_wire_line=0; //previously dumped wire line - int start_bit=cell_output->width; + int start_bit=0; for(unsigned j=0; j<cell_output->chunks.size(); ++j) { + start_bit+=cell_output->chunks[j].width; if(cell_output->chunks[j].wire->name == wire->name) { prev_wire_line = wire_line; @@ -186,12 +187,11 @@ struct BtorDumper if(prev_wire_line!=0) { ++line_num; - str = stringf("%d concat %d %d %d", line_num, wire_width, prev_wire_line, wire_line); + str = stringf("%d concat %d %d %d", line_num, wire_width, wire_line, prev_wire_line); fprintf(f, "%s\n", str.c_str()); wire_line = line_num; } } - start_bit-=cell_output->chunks[j].width; } } } @@ -531,7 +531,7 @@ struct BtorDumper bool polarity = cell->parameters.at(RTLIL::IdString("\\CLK_POLARITY")).as_bool(); const RTLIL::SigSpec* cell_output = &cell->connections.at(RTLIL::IdString("\\Q")); int value = dump_sigspec(&cell->connections.at(RTLIL::IdString("\\D")), output_width); - unsigned start_bit = output_width; + unsigned start_bit = 0; for(unsigned i=0; i<cell_output->chunks.size(); ++i) { output_width = cell_output->chunks[i].width; @@ -540,11 +540,11 @@ struct BtorDumper int slice = value; if(cell_output->chunks.size()>1) { + start_bit+=output_width; slice = ++line_num; str = stringf ("%d slice %d %d %d %d;", line_num, output_width, value, start_bit-1, start_bit-output_width); fprintf(f, "%s\n", str.c_str()); - start_bit-=output_width; } if(cell->type == "$dffsr") { |