<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sfcX/src/main/scala/firrtl/transforms, branch 1.6.x</title>
<subtitle>Scala FIRRTL Compiler for chiselX</subtitle>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/'/>
<entry>
<title>Fix optimization of register with reset but invalid connection (#2520)</title>
<updated>2022-04-22T03:20:47+00:00</updated>
<author>
<name>Jack Koenig</name>
</author>
<published>2022-04-22T03:20:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=5093da03083a37a0a7bdaf44f9867d7f7a0a5980'/>
<id>5093da03083a37a0a7bdaf44f9867d7f7a0a5980</id>
<content type='text'>
Fixes #2516

Previously,

reg r : UInt&lt;8&gt;, clock with :
  reset =&gt; (p, UInt&lt;8&gt;(3))
r is invalid

would compile to:

reg r : UInt&lt;8&gt;, clock
r &lt;= UInt&lt;8&gt;(0)

now it compiles to:

reg r : UInt&lt;8&gt;, clock
wire r_1 : UInt&lt;8&gt;
r_1 is invalid
r &lt;= mux(reset, UInt&lt;8&gt;(3), r_1)

This is consistent with the behavior for a reset with an asynchronous
reset.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #2516

Previously,

reg r : UInt&lt;8&gt;, clock with :
  reset =&gt; (p, UInt&lt;8&gt;(3))
r is invalid

would compile to:

reg r : UInt&lt;8&gt;, clock
r &lt;= UInt&lt;8&gt;(0)

now it compiles to:

reg r : UInt&lt;8&gt;, clock
wire r_1 : UInt&lt;8&gt;
r_1 is invalid
r &lt;= mux(reset, UInt&lt;8&gt;(3), r_1)

This is consistent with the behavior for a reset with an asynchronous
reset.</pre>
</div>
</content>
</entry>
<entry>
<title>preset: make PropagatePreset play nice with verification statements (#2453)</title>
<updated>2022-01-19T19:42:25+00:00</updated>
<author>
<name>Kevin Laeufer</name>
</author>
<published>2022-01-19T19:42:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=c98ee33827d21f88911f2ca1a6e04bcbb3864fe8'/>
<id>c98ee33827d21f88911f2ca1a6e04bcbb3864fe8</id>
<content type='text'>
Verification statements are guarded by reset.
If this reset happens to be a "preset" type
reset, they should always be active.
The easiest way to achieve that is to replace
all uses of "preset" resets with zero.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Verification statements are guarded by reset.
If this reset happens to be a "preset" type
reset, they should always be active.
The easiest way to achieve that is to replace
all uses of "preset" resets with zero.</pre>
</div>
</content>
</entry>
<entry>
<title>Add FileInfo to asyncResetAlwaysBlocks (#2451)</title>
<updated>2022-01-06T04:17:52+00:00</updated>
<author>
<name>sinofp</name>
</author>
<published>2022-01-06T04:17:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=3e494b5cceda14a73f288a293dd007a82be18bb8'/>
<id>3e494b5cceda14a73f288a293dd007a82be18bb8</id>
<content type='text'>
* Add FileInfo to asyncResetAlwaysBlocks

Always blocks need three FileInfo (if, true, false) to show line numbers,
but initially, every always blocks only have one FileInfo (false).

RemoveReset adds the extra two FileInfo to sync always blocks,
so sync always blocks can have line numbers.

Async always blocks don't provide their only FileInfo, so there are no line numbers.

This commit gives async always block the extra FileInfo to show line numbers for them.

This code:

```scala
import chisel3._
import chisel3.stage._
import firrtl.CustomDefaultRegisterEmission

class Test extends Module with RequireAsyncReset {
  val io = IO(new Bundle {
    val in = Input(Bool())
    val out = Output(Bool())
  })
  val valid = RegInit(false.B)
  valid := io.in
  io.out := valid
}

object Test extends App {
  new ChiselStage().execute(Array(), Seq(
    ChiselGeneratorAnnotation(() =&gt; new Test()),
    CustomDefaultRegisterEmission(useInitAsPreset = false, disableRandomization = true)
  ))
}
```

will generate this Verilog:

```verilog
module Test(
  input   clock,
  input   reset,
  input   io_in,
  output  io_out
);
  reg  valid; // @[Playground.scala 10:22]
  assign io_out = valid; // @[Playground.scala 12:10]
  always @(posedge clock or posedge reset) begin
    if (reset) begin // @[Playground.scala 10:22]
      valid &lt;= 1'h0; // @[Playground.scala 10:22]
    end else begin
      valid &lt;= io_in; // @[Playground.scala 11:9]
    end
  end
endmodule
```

they have correct line numbers (10, 10, 11).

* Add test for async always block line numbers

* Add comment for review</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add FileInfo to asyncResetAlwaysBlocks

Always blocks need three FileInfo (if, true, false) to show line numbers,
but initially, every always blocks only have one FileInfo (false).

RemoveReset adds the extra two FileInfo to sync always blocks,
so sync always blocks can have line numbers.

Async always blocks don't provide their only FileInfo, so there are no line numbers.

This commit gives async always block the extra FileInfo to show line numbers for them.

This code:

```scala
import chisel3._
import chisel3.stage._
import firrtl.CustomDefaultRegisterEmission

class Test extends Module with RequireAsyncReset {
  val io = IO(new Bundle {
    val in = Input(Bool())
    val out = Output(Bool())
  })
  val valid = RegInit(false.B)
  valid := io.in
  io.out := valid
}

object Test extends App {
  new ChiselStage().execute(Array(), Seq(
    ChiselGeneratorAnnotation(() =&gt; new Test()),
    CustomDefaultRegisterEmission(useInitAsPreset = false, disableRandomization = true)
  ))
}
```

will generate this Verilog:

```verilog
module Test(
  input   clock,
  input   reset,
  input   io_in,
  output  io_out
);
  reg  valid; // @[Playground.scala 10:22]
  assign io_out = valid; // @[Playground.scala 12:10]
  always @(posedge clock or posedge reset) begin
    if (reset) begin // @[Playground.scala 10:22]
      valid &lt;= 1'h0; // @[Playground.scala 10:22]
    end else begin
      valid &lt;= io_in; // @[Playground.scala 11:9]
    end
  end
endmodule
```

they have correct line numbers (10, 10, 11).

* Add test for async always block line numbers

* Add comment for review</pre>
</div>
</content>
</entry>
<entry>
<title>Remove some warnings (#2448)</title>
<updated>2021-12-22T02:47:18+00:00</updated>
<author>
<name>Jack Koenig</name>
</author>
<published>2021-12-22T02:47:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=4f3d1003811aa38d10e32b347c8607414d9be034'/>
<id>4f3d1003811aa38d10e32b347c8607414d9be034</id>
<content type='text'>
* Fix unreachable code warning by changing match order

Simulation Statements did not previously extend IsDeclaration, but now
they do so their match blocks need to be above IsDeclaration.

* Handle MemoryNoInit case in RtlilEmitter

* Remove use of deprecated logToFile

* Fix uses of LegalizeClocksTransform

Replaced all uses of LegalizeClocksTransform with
LegalizeClocksAndAsyncResetsTransform.

* Remove use of CircuitForm in ZeroWidth</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix unreachable code warning by changing match order

Simulation Statements did not previously extend IsDeclaration, but now
they do so their match blocks need to be above IsDeclaration.

* Handle MemoryNoInit case in RtlilEmitter

* Remove use of deprecated logToFile

* Fix uses of LegalizeClocksTransform

Replaced all uses of LegalizeClocksTransform with
LegalizeClocksAndAsyncResetsTransform.

* Remove use of CircuitForm in ZeroWidth</pre>
</div>
</content>
</entry>
<entry>
<title>Deprecate all mutable methods on RenameMap (#2444)</title>
<updated>2021-12-17T18:07:25+00:00</updated>
<author>
<name>Jack Koenig</name>
</author>
<published>2021-12-17T18:07:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=37c8528cfed4395924820b54498ef761ded17393'/>
<id>37c8528cfed4395924820b54498ef761ded17393</id>
<content type='text'>
* Add renamemap.MutableRenameMap which includes these methods without
  deprecation
* Deprecate Stringly typed RenameMap APIs which were accidentally
  undeprecated a while ago

Co-authored-by: mergify[bot] &lt;37929162+mergify[bot]@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add renamemap.MutableRenameMap which includes these methods without
  deprecation
* Deprecate Stringly typed RenameMap APIs which were accidentally
  undeprecated a while ago

Co-authored-by: mergify[bot] &lt;37929162+mergify[bot]@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Modify and optimize performance of propagate annotations (#2393)</title>
<updated>2021-12-17T17:25:38+00:00</updated>
<author>
<name>Jack Koenig</name>
</author>
<published>2021-12-17T17:25:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=02e46bdb40b76c9f7803dd1ae4f18b388f9d55a4'/>
<id>02e46bdb40b76c9f7803dd1ae4f18b388f9d55a4</id>
<content type='text'>
* Change AnnotationSeq underlying from List to Seq

It was nothing but pointless copying.

* Make propagateAnnotations faster

There was lots of expensive logic for very little benefit.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Change AnnotationSeq underlying from List to Seq

It was nothing but pointless copying.

* Make propagateAnnotations faster

There was lots of expensive logic for very little benefit.</pre>
</div>
</content>
</entry>
<entry>
<title>Implement CustomRadixTransform for wave viewers (#2434)</title>
<updated>2021-12-13T18:50:28+00:00</updated>
<author>
<name>Jiuyang Liu</name>
</author>
<published>2021-12-13T18:50:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=7f884493073248576e896163dda350c997dd4ff2'/>
<id>7f884493073248576e896163dda350c997dd4ff2</id>
<content type='text'>
1. Add CustomRadix{Def,Apply}Annotation to define and apply custom radix.
2. Add CustomRadixConfigFileAnnotation to output a JSON config file so
   users can generate scripts on their own.

Reviewed-by: Jiuyang Liu &lt;liu@jiuyang.me&gt;
Co-authored-by: sinofp &lt;sinofp@tuta.io&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Add CustomRadix{Def,Apply}Annotation to define and apply custom radix.
2. Add CustomRadixConfigFileAnnotation to output a JSON config file so
   users can generate scripts on their own.

Reviewed-by: Jiuyang Liu &lt;liu@jiuyang.me&gt;
Co-authored-by: sinofp &lt;sinofp@tuta.io&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>remove firrtl.transforms.BlackBoxSourceHelper.fileListName. (#2426)</title>
<updated>2021-11-22T20:25:12+00:00</updated>
<author>
<name>Jiuyang Liu</name>
</author>
<published>2021-11-22T20:25:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=8bc8a11514d50d1228872e3dd68347c75fea0e4e'/>
<id>8bc8a11514d50d1228872e3dd68347c75fea0e4e</id>
<content type='text'>
Co-authored-by: mergify[bot] &lt;37929162+mergify[bot]@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: mergify[bot] &lt;37929162+mergify[bot]@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>remove firrtl.transforms.InferResets.DifferingDriverTypesException (#2425)</title>
<updated>2021-11-22T20:12:22+00:00</updated>
<author>
<name>Jiuyang Liu</name>
</author>
<published>2021-11-22T20:12:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=577327379a16e7329f22e971d8dd913c0bdbaaca'/>
<id>577327379a16e7329f22e971d8dd913c0bdbaaca</id>
<content type='text'>
Co-authored-by: mergify[bot] &lt;37929162+mergify[bot]@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: mergify[bot] &lt;37929162+mergify[bot]@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>remove firrtl.transforms.InlineAcrossCastsTransform. (#2424)</title>
<updated>2021-11-22T20:01:26+00:00</updated>
<author>
<name>Jiuyang Liu</name>
</author>
<published>2021-11-22T20:01:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=79e3ba1df73ef283a271751e250cbd93dd99c885'/>
<id>79e3ba1df73ef283a271751e250cbd93dd99c885</id>
<content type='text'>
Co-authored-by: mergify[bot] &lt;37929162+mergify[bot]@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: mergify[bot] &lt;37929162+mergify[bot]@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
</feed>
