<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sfcX/src/main/scala/firrtl/backends/verilog, branch master</title>
<subtitle>Scala FIRRTL Compiler for chiselX</subtitle>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/'/>
<entry>
<title>Fold VerilogModulusCleanup into LegalizeVerilog (#2485)</title>
<updated>2022-03-02T17:31:57+00:00</updated>
<author>
<name>Jack Koenig</name>
</author>
<published>2022-03-02T17:31:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=95cae3cd0eb9ac72eb6373207dbf9f09fb1c7086'/>
<id>95cae3cd0eb9ac72eb6373207dbf9f09fb1c7086</id>
<content type='text'>
This fixes handling of signed modulus and removes some redundant work.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes handling of signed modulus and removes some redundant work.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix faulty MemorySynthInit behavior (#2468)</title>
<updated>2022-01-27T04:50:47+00:00</updated>
<author>
<name>John's Brew</name>
</author>
<published>2022-01-27T04:50:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=475c165ccf8a52f79a94766450c23090f15d1393'/>
<id>475c165ccf8a52f79a94766450c23090f15d1393</id>
<content type='text'>
- Fix &amp; test MemorySynthInit behavior with MemoryArrayInitAnnotation and MemoryScalarInitAnnotation.
Add test case for MemoryRandomInitAnnotation which is, on the contrary, expected not to leak any randomization statement in synthesis context.

- Refactor MemoryInitSpec for improved results readability

Context:

PR #2166 (commit: 4530152) introduced MemorySynthInit annotation to control whether statement generated with Memory*InitAnnotation (emitted within initial begin block in verilog) should be guarded with ifndef SYNTHESIS or not.
Unfortunately only one configuration (MemoryFileInlineAnnotation) has been tested while the others have been generating incorrect verilog statements (MemoryArrayInitAnnotation and MemoryScalarInitAnnotation).

Signed-off-by: Jean Bruant &lt;jean.bruant@ovhcloud.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Fix &amp; test MemorySynthInit behavior with MemoryArrayInitAnnotation and MemoryScalarInitAnnotation.
Add test case for MemoryRandomInitAnnotation which is, on the contrary, expected not to leak any randomization statement in synthesis context.

- Refactor MemoryInitSpec for improved results readability

Context:

PR #2166 (commit: 4530152) introduced MemorySynthInit annotation to control whether statement generated with Memory*InitAnnotation (emitted within initial begin block in verilog) should be guarded with ifndef SYNTHESIS or not.
Unfortunately only one configuration (MemoryFileInlineAnnotation) has been tested while the others have been generating incorrect verilog statements (MemoryArrayInitAnnotation and MemoryScalarInitAnnotation).

Signed-off-by: Jean Bruant &lt;jean.bruant@ovhcloud.com&gt;</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>Disable random init (#2396)</title>
<updated>2021-11-19T19:17:37+00:00</updated>
<author>
<name>Jiuyang Liu</name>
</author>
<published>2021-11-19T19:17:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=b027eb466b033a0a9d229f19feb931ddb292a9fa'/>
<id>b027eb466b033a0a9d229f19feb931ddb292a9fa</id>
<content type='text'>
* Add option to disable random mem/reg init

Co-authored-by: Jiuyang Liu &lt;liu@jiuyang.me&gt;

* fix for code review.

Co-authored-by: SharzyL &lt;me@sharzy.in&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add option to disable random mem/reg init

Co-authored-by: Jiuyang Liu &lt;liu@jiuyang.me&gt;

* fix for code review.

Co-authored-by: SharzyL &lt;me@sharzy.in&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>typo: correct Error Info (#2398)</title>
<updated>2021-10-28T13:33:16+00:00</updated>
<author>
<name>SingularityKChen</name>
</author>
<published>2021-10-28T13:33:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=e298b01d3086e78c187cb1c3611a206216499031'/>
<id>e298b01d3086e78c187cb1c3611a206216499031</id>
<content type='text'>
+ correct the Error Info of "At least one dedupable annotation..."</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
+ correct the Error Info of "At least one dedupable annotation..."</pre>
</div>
</content>
</entry>
<entry>
<title>add emitter for optimized low firrtl (#2304)</title>
<updated>2021-08-02T20:46:29+00:00</updated>
<author>
<name>Kevin Laeufer</name>
</author>
<published>2021-08-02T20:46:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=e04f1e7f303920ac1d1f865450d0e280aafb58b3'/>
<id>e04f1e7f303920ac1d1f865450d0e280aafb58b3</id>
<content type='text'>
* rearrange passes to enable optimized firrtl emission

* Support ConstProp on padded arguments to comparisons with literals

* Move shr legalization logic into ConstProp

Continue calling ConstProp of shr in Legalize.

Co-authored-by: Jack Koenig &lt;koenig@sifive.com&gt;

Co-authored-by: Jack Koenig &lt;koenig@sifive.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* rearrange passes to enable optimized firrtl emission

* Support ConstProp on padded arguments to comparisons with literals

* Move shr legalization logic into ConstProp

Continue calling ConstProp of shr in Legalize.

Co-authored-by: Jack Koenig &lt;koenig@sifive.com&gt;

Co-authored-by: Jack Koenig &lt;koenig@sifive.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Dedup attribute annos (#2297)</title>
<updated>2021-07-29T23:31:08+00:00</updated>
<author>
<name>Jared Barocsi</name>
</author>
<published>2021-07-29T23:31:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=04210ee30acd437bccfe694ddd895e5f450ba01f'/>
<id>04210ee30acd437bccfe694ddd895e5f450ba01f</id>
<content type='text'>
* Add new util "groupByIntoSeq"
* Restore annotation order when dedupping annotations
* Attribute annotations now deduplicate
* Implement doc string anno dedup

Co-authored-by: Jack Koenig &lt;koenig@sifive.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add new util "groupByIntoSeq"
* Restore annotation order when dedupping annotations
* Attribute annotations now deduplicate
* Implement doc string anno dedup

Co-authored-by: Jack Koenig &lt;koenig@sifive.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Fix memory annotation deduplication (#2286)</title>
<updated>2021-07-14T20:10:15+00:00</updated>
<author>
<name>Jared Barocsi</name>
</author>
<published>2021-07-14T20:10:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=4081d9f45a30d9f9e5711563b828f34257d4c19d'/>
<id>4081d9f45a30d9f9e5711563b828f34257d4c19d</id>
<content type='text'>
* Add transform to deduplicate memory annotations
* Add annotation deduplication to Dedup stage
* ResolveAnnotationPaths and EliminateTargetPaths now invalidate the dedup annotations transform
* Verilog emitter now throws exception when memory annotations fail to dedup

Co-authored-by: Jack Koenig &lt;koenig@sifive.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add transform to deduplicate memory annotations
* Add annotation deduplication to Dedup stage
* ResolveAnnotationPaths and EliminateTargetPaths now invalidate the dedup annotations transform
* Verilog emitter now throws exception when memory annotations fail to dedup

Co-authored-by: Jack Koenig &lt;koenig@sifive.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Don't use declaration-assigns for wires representing mem ports (#2189)</title>
<updated>2021-04-19T15:50:18+00:00</updated>
<author>
<name>Albert Magyar</name>
</author>
<published>2021-04-19T15:50:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=72afdefd0f2e894d5dfe346aae36a23b2fd25def'/>
<id>72afdefd0f2e894d5dfe346aae36a23b2fd25def</id>
<content type='text'>
* Fixes #2173</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fixes #2173</pre>
</div>
</content>
</entry>
<entry>
<title>Allow direct emission of sync-read memories to Verilog</title>
<updated>2021-04-05T19:00:02+00:00</updated>
<author>
<name>Albert Magyar</name>
</author>
<published>2021-03-10T05:30:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sfcX/commit/?id=a90cf1105467cab7c6708ea3faae35e1454cb0fd'/>
<id>a90cf1105467cab7c6708ea3faae35e1454cb0fd</id>
<content type='text'>
* Emit readwrite ports, if applicable
* Does not change VerilogMemDelays -&gt; no effect on default flow
* Use more single-line declare-and-assign statements for mem wires
* Update error messages for too-complex memories in VerilogEmitter
* Run scalafmt on VerilogEmitter
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Emit readwrite ports, if applicable
* Does not change VerilogMemDelays -&gt; no effect on default flow
* Use more single-line declare-and-assign statements for mem wires
* Update error messages for too-complex memories in VerilogEmitter
* Run scalafmt on VerilogEmitter
</pre>
</div>
</content>
</entry>
</feed>
