Skip to content

Commit 285c39e

Browse files
committed
[docs] Reformat Moore docs; NFC
1 parent 89655ab commit 285c39e

File tree

1 file changed

+37
-29
lines changed

1 file changed

+37
-29
lines changed

docs/Dialects/Moore.md

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,17 @@ This dialect provides operations and types to capture a SystemVerilog design aft
77

88
## Rationale
99

10-
The main goal of the `moore` dialect is to provide a set of operations and types for the `ImportVerilog` conversion to translate a fully parsed, type-checked, and elaborated Slang AST into MLIR operations. See IEEE 1800-2017 for more details about SystemVerilog. The dialect aims to faithfully capture the full SystemVerilog types and semantics, and provide a platform for transformation passes to resolve language quirks, analyze the design at a high level, and lower it to the core dialects.
10+
The main goal of the `moore` dialect is to provide a set of operations and types for the `ImportVerilog` conversion to translate a fully parsed, type-checked, and elaborated Slang AST into MLIR operations.
11+
See IEEE 1800-2017 for more details about SystemVerilog.
12+
The dialect aims to faithfully capture the full SystemVerilog types and semantics, and provide a platform for transformation passes to resolve language quirks, analyze the design at a high level, and lower it to the core dialects.
1113

12-
In contrast, the `sv` dialect is geared towards emission of SystemVerilog text, and is focused on providing a good lowering target to allow for emission. The `moore` and `sv` dialect may eventually converge into a single dialect. As we are building out the Verilog frontend capabilities of CIRCT it is valuable to have a separate ingestion dialect, such that we do not have to make disruptive changes to the load-bearing `sv` dialect used in production.
14+
In contrast, the `sv` dialect is geared towards emission of SystemVerilog text, and is focused on providing a good lowering target to allow for emission.
15+
The `moore` and `sv` dialect may eventually converge into a single dialect.
16+
As we are building out the Verilog frontend capabilities of CIRCT it is valuable to have a separate ingestion dialect, such that we do not have to make disruptive changes to the load-bearing `sv` dialect used in production.
1317

14-
## LRM Rules
15-
### Unconnection rules
16-
The SystemVerilog LRM defines unconnected behavior while leaving ports unconnected.
1718

18-
| Port Type | Unconnected Behavior |
19-
| ---------------- | -------------------------- |
20-
| Input (Net) | High-impedance value ('Z) |
21-
| Input (Variable) | Default initial value |
22-
| Output | No effect on Simulation |
23-
| Inout (Net) | High-impedance value ('Z) |
24-
| Inout (Variable) | Default initial value |
25-
| Ref | Cannot be left unconnected |
26-
| Interconnect | Cannot be left unconnected |
27-
| Interface | Cannot be left unconnected |
19+
## LRM Rules
2820

29-
For variables that do not have a specified initializer. It has a default rule to initialize data value according to its type:
30-
31-
| Type | Default initial value |
32-
| --------------------------- | ------------------------------- |
33-
| 4-state integral | 'X |
34-
| 2-state integral | '0 |
35-
| **real**, **shortreal** | 0.0 |
36-
| Enumeration | Base type default initial value |
37-
| **string** | "" (empty string) |
38-
| **event** | New event |
39-
| **class** | **null** |
40-
| **interface class** | **null** |
41-
| **chandle (Opaque handle)** | **null** |
42-
| **virtual interface** | **null** |
4321

4422
## Types
4523

@@ -59,6 +37,36 @@ The `moore.iN` and `moore.lN` types represent a two-valued or four-valued simple
5937
| `longint` | `!moore.i64` |
6038
| `time` | `!moore.l64` |
6139

40+
### Default Values
41+
42+
Behavior of unconnected ports:
43+
44+
| Port Type | Unconnected Behavior |
45+
| ---------------- | -------------------------- |
46+
| Input (Net) | High-impedance value ('Z) |
47+
| Input (Variable) | Default initial value |
48+
| Output | No effect on Simulation |
49+
| Inout (Net) | High-impedance value ('Z) |
50+
| Inout (Variable) | Default initial value |
51+
| Ref | Cannot be left unconnected |
52+
| Interconnect | Cannot be left unconnected |
53+
| Interface | Cannot be left unconnected |
54+
55+
Uninitialized variables:
56+
57+
| Type | Default initial value |
58+
| ------------------- | ------------------------------- |
59+
| 4-state integral | 'X |
60+
| 2-state integral | '0 |
61+
| `real`, `shortreal` | 0.0 |
62+
| Enumeration | Base type default initial value |
63+
| `string` | "" (empty string) |
64+
| `event` | New event |
65+
| `class` | `null` |
66+
| `interface class` | `null` |
67+
| `chandle` | `null` |
68+
| `virtual interface` | `null` |
69+
6270
[include "Dialects/MooreTypes.md"]
6371

6472

0 commit comments

Comments
 (0)