Skip to content

Commit 64c3009

Browse files
authored
Merge pull request #93 from sdnellen/master
Merge of sdnellen fork
2 parents af7184e + 449b496 commit 64c3009

262 files changed

Lines changed: 48714 additions & 851 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Handle line endings automatically for files detected as text
2+
# and leave all files detected as binary untouched.
3+
* text=auto
4+
5+
# Never modify line endings of our bash scripts
6+
*.sh -crlf
7+
test/** -text
8+
9+
#
10+
# The above will handle all files NOT found below
11+
#
12+
# These files are text and should be normalized (Convert crlf => lf)
13+
*.css text
14+
*.html text
15+
*.java text
16+
*.js text
17+
*.json text
18+
*.properties text
19+
*.txt text
20+
*.xml text
21+
22+
# These files are binary and should be left untouched
23+
# (binary is macro for -text -diff)
24+
*.class binary
25+
*.jar binary
26+
*.gif binary
27+
*.jpg binary
28+
*.png binary

.github/workflows/ci.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Java CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
20+
- name: Set up JDK
21+
uses: actions/setup-java@v2
22+
with:
23+
distribution: 'adopt'
24+
java-version: '8' # Adjust the Java version as needed
25+
26+
- name: Build with Gradle
27+
run: ./gradlew build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ hs_err_pid*
3232
/test/**/output/
3333
/test/scripts/test.setup
3434
/rdl/
35+
/rdl_local/
3536

3637
# gradle stuff
3738
/.gradle/

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "java",
9+
"name": "Ordt",
10+
"request": "launch",
11+
"mainClass": "ordt.extract.Ordt",
12+
"projectName": "ordt"
13+
}
14+
]
15+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "automatic"
3+
}

.vscode/tasks.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "java (build)",
6+
"paths": [
7+
"${workspace}"
8+
],
9+
"isFullBuild": true,
10+
"group": {
11+
"kind": "build",
12+
"isDefault": true
13+
},
14+
"problemMatcher": [],
15+
"label": "java (build): Build Workspace",
16+
"detail": "$(tools) Build all the Java projects in workspace."
17+
}
18+
]
19+
}

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ The tool can generate several outputs from SystemRDL or JSpec, including:
88
- SystemVerilog/Verilog RTL code description of registers
99
- UVM model of the registers
1010
- C++ and python models of the registers
11+
- C header file providing register address and field defines
1112
- XML and text file register descriptions
1213
- SystemRDL and JSpec (conversion)
1314

14-
Easiest way to get started with ordt is to download a runnable jar from the [release area](https://github.com/Juniper/open-register-design-tool/releases).
15-
Ordt documentation can be found [here](https://github.com/Juniper/open-register-design-tool/wiki).
15+
Easiest way to get started with ordt is to download a runnable jar from the [release area](https://github.com/sdnellen/open-register-design-tool/releases). Older releases can be found at the [Juniper repo release area](https://github.com/Juniper/open-register-design-tool/releases).
16+
Ordt documentation can be found [here](https://github.com/sdnellen/open-register-design-tool/wiki).

build.gradle

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ repositories {
2727

2828
dependencies {
2929
compile 'org.abego.treelayout:org.abego.treelayout.core:1.0.3'
30-
antlr 'org.antlr:antlr4:4.5.1-1'
31-
runtime 'org.antlr:antlr4-runtime:4.5.1-1'
30+
antlr 'org.antlr:antlr4:4.5.3'
31+
runtime 'org.antlr:antlr4-runtime:4.5.3'
3232
}
3333

3434
final antlrSrc = 'src/ordt/parse/grammars'
@@ -42,7 +42,7 @@ sourceSets {
4242
'src/ordt/extract',
4343
'src/ordt/output',
4444
'src/ordt/parameters',
45-
antlrGen ]
45+
'src/ordt/parse' ]
4646
}
4747
antlr {
4848
srcDirs = [ antlrSrc ]
@@ -70,7 +70,14 @@ compileJava.dependsOn(copyMyDebugController)
7070

7171
generateGrammarSource {
7272
outputs.upToDateWhen { false } // force compile of all grammar files so import dependencies are picked up
73-
// outputDirectory = file(antlrGen)
73+
// copy all generated antlr files to their package locations - not optimum, but avoids ide issues due to package mismatch
74+
doLast {
75+
final destFolder = 'src'
76+
copyAntlrGeneratedFilesToTheirPackages(antlrSrc, 'ExtParms', antlrGen, destFolder)
77+
copyAntlrGeneratedFilesToTheirPackages(antlrSrc, 'JSpec', antlrGen, destFolder)
78+
copyAntlrGeneratedFilesToTheirPackages(antlrSrc, 'SystemRDL', antlrGen, destFolder)
79+
copyAntlrGeneratedFilesToTheirPackages(antlrSrc, 'SimpleSV', antlrGen, destFolder)
80+
}
7481
}
7582

7683
shadowJar {
@@ -99,31 +106,14 @@ task distclean {
99106
}
100107
}
101108

102-
// eclipse ide expects java source files to be in directories corresponding to their package.
103-
// the generateEclipseGrammarSource generates the antlr output and moves output java files into
104-
// their respective package directories (note that not all grammars need to be copied)
105-
task generateEclipseGrammarSource {
106-
dependsOn generateGrammarSource
107-
doLast {
108-
final destFolder = 'src'
109-
moveAntlrGeneratedFilesToTheirPackages(antlrSrc, 'ExtParms', antlrGen, destFolder)
110-
moveAntlrGeneratedFilesToTheirPackages(antlrSrc, 'JSpec', antlrGen, destFolder)
111-
moveAntlrGeneratedFilesToTheirPackages(antlrSrc, 'SystemRDL', antlrGen, destFolder)
112-
//moveAntlrGeneratedFilesToTheirPackages(antlrSrc, 'SimpleSVLexer', antlrGen, destFolder)
113-
//moveAntlrGeneratedFilesToTheirPackages(antlrSrc, 'SimpleSVParser', antlrGen, destFolder)
114-
moveAntlrGeneratedFilesToTheirPackages(antlrSrc, 'SimpleSV', antlrGen, destFolder)
115-
}
116-
}
117-
118-
def moveAntlrGeneratedFilesToTheirPackages(grammarFolder, grammarName, genFolder, destFolder) {
109+
def copyAntlrGeneratedFilesToTheirPackages(grammarFolder, grammarName, genFolder, destFolder) {
119110
File grammarFile = file("${grammarFolder}/${grammarName}.g4")
120111
final grammarPackage = extractPackageNameFromGrammerFile(grammarFile)
121112
copy {
122113
from genFolder
123114
include "${grammarName}*.*"
124115
into destFolder + "/" + grammarPackage.replaceAll("\\.", "/")
125116
}
126-
project.delete fileTree(genFolder).include("${grammarName}*.*")
127117
}
128118

129119
def extractPackageNameFromGrammerFile(File grammarFile) {

example.parms

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ input rdl {
2828
output systemverilog {
2929
leaf_address_size = 40 // leaf address bits
3030
//root_has_leaf_interface = true // does root module talk directly to leaf DEPRECATED
31-
root_decoder_interface = spi_PIO // parallel | parallel_pulsed | leaf | serial8 | ring8 | ring16 | ring32 | spi_PIO
31+
root_decoder_interface = parallel // parallel | parallel_pulsed | leaf | serial8 | ring8 | ring16 | ring32 | spi_PIO
3232
//secondary_decoder_interface = serial8 // parallel | parallel_pulsed | serial8 | ring8 | ring16 | ring32 | spi_PIO | none
3333
//secondary_base_address = 0x40 // base address as viewed from driver of secondary decoder interface
3434
//secondary_low_address = 0x50 // low valid address on secondary decoder interfaces
3535
//secondary_high_address = 0x5f // high valid address on secondary decoder interfaces
3636
//secondary_on_child_addrmaps = true // add secondary interface to child decoders also
3737
base_addr_is_parameter = false // base address parameter will be added to top module
3838
//module_tag = "_version1" // tag to be added to generated module names
39-
//use_gated_logic_clock = false // use separate gated clock for registers and generate a clk enable output
40-
//gated_logic_access_delay = 5 // number of clocks after clk enable before gated logic is accessed
39+
use_gated_logic_clock = true // use separate gated clock for registers and generate a clk enable output
40+
gated_logic_access_delay = 2 // number of clocks after clk enable before gated logic is accessed
4141
//use_external_select = true // use an externally generated block select DEPRECATED
4242
block_select_mode = always // is block select generated internally, externally or always
4343
//export_start_end = true // create addr_start, addr_end outputs
@@ -61,7 +61,7 @@ output systemverilog {
6161
//}
6262
//separate_iwrap_encap_files = true // generate a separate file for each wrap encap (interface/struct) type
6363
generate_dv_bind_modules = true // if true generate diagnostic dv bind modules
64-
use_global_dv_bind_controls = true // if true diagnostic dv bind module settings will be controlled by global packages
64+
use_global_dv_bind_controls = false // if true diagnostic dv bind module settings will be controlled by global packages
6565
//include_addr_monitor = true // generate io to monitor decoder transactions to a specified address range
6666
generate_iwrap_xform_modules = false // generate common wrapper transform modules
6767
//include_sequential_assign_delays = true // include #1 delay on sequential assigns

rdl_examples/issue_16.rdl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// issue 16 debug
2+
<PARMS>
3+
output systemverilog {
4+
root_decoder_interface = parallel // parallel | parallel_pulsed | leaf | serial8 | ring8 | ring16 | ring32
5+
pulse_intr_on_clear = false // pulse interrupt output low if any child in intr tree is cleared
6+
include_default_coverage = true // include default cover points in rtl
7+
generate_dv_bind_modules = false // if true generate diagnostic dv bind modules
8+
}
9+
</PARMS>
10+
11+
regfile t_rf {
12+
reg {
13+
field { reset=1'd0; } fld1 ;
14+
field { reset=1'd0; counter; } count1[5] ;
15+
field { reset=1'd0; intr; } intr1[5] ;
16+
} reg1 ;
17+
} ;
18+
19+
addrmap {
20+
signal {field_reset; activelow;} teser_n;
21+
t_rf rf1 @0x0;
22+
t_rf rf2 @0x100;
23+
} basemap;

0 commit comments

Comments
 (0)