Skip to content

Commit 6c8bd23

Browse files
committed
[SystemRDL] Create a sonata top level description
Signed-off-by: Douglas Reis <doreis@lowrisc.org>
1 parent f8c868a commit 6c8bd23

13 files changed

Lines changed: 4652 additions & 0 deletions

File tree

data/top.rdl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
`include "udp.rdl"
2+
`include "../rtl/ip/system_info/data/system_info.rdl"
3+
`include "../rtl/ip/spi/data/spi.rdl"
4+
`include "../rtl/ip/rgbled_ctrl/data/rgbled_ctrl.rdl"
5+
`include "../rtl/ip/pwm/data/pwm.rdl"
6+
`include "../rtl/ip/gpio/data/gpio.rdl"
7+
`include "../rtl/ip/usbdev/data/usbdev.rdl"
8+
`include "../rtl/ip/i2c/data/i2c.rdl"
9+
`include "../rtl/ip/uart/data/uart.rdl"
10+
`include "../rtl/system/autogen/rv_plic/data/rv_plic.rdl"
11+
12+
addrmap top_sonata {
13+
gpio GPIO @ 0x80000000;
14+
gpio GPIO_RPI @ 0x80000040;
15+
gpio GPIO_ARDUINO @ 0x80000080;
16+
gpio GPIO_PMOD[2] @ 0x800000C0 += 0x40;
17+
gpio GPIO_PMODC @ 0x80000140;
18+
pwm PWM[6] @ 0x80001000 += 0x08;
19+
pwm PWM_LCD;
20+
rgbled_ctrl RGBLED_CTRL @ 0x80009000;
21+
system_info SYSTEM_INFO @ 0x8000C000;
22+
uart uart[3] @ 0x80100000 += 0x1000;
23+
i2c I2C[2] @ 0x80200000 += 0x1000;
24+
spi SPI_LCD @ 0x80300000;
25+
spi SPI_ETHMAC @ 0x80301000;
26+
spi SPI[3] @ 0x80302000 += 0x1000;
27+
usbdev USBDEV @ 0x80400000;
28+
rv_plic RV_PLIC @ 0x88000000;
29+
};
30+

data/udp.rdl

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/* Copyright lowRISC contributors (OpenTitan project).
2+
* Licensed under the Apache License, Version 2.0; see LICENSE for details.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/**
7+
* 4-bits boolean values
8+
*/
9+
enum MultiBitBool4 {
10+
True = 0x6;
11+
False = 0x9;
12+
};
13+
14+
/**
15+
* 8-bits boolean values
16+
*/
17+
enum MultiBitBool8 {
18+
True = 0x96;
19+
False = 0x69;
20+
};
21+
22+
/**
23+
* 12-bits boolean values
24+
*/
25+
enum MultiBitBool12 {
26+
True = 0x696;
27+
False = 0x969;
28+
};
29+
30+
/**
31+
* 16-bits boolean values
32+
*/
33+
enum MultiBitBool16 {
34+
True = 0x9696;
35+
False = 0x6969;
36+
};
37+
38+
/**
39+
* 20-bits boolean values
40+
*/
41+
enum MultiBitBool20 {
42+
True = 0x69696;
43+
False = 0x96969;
44+
};
45+
46+
/**
47+
* 24-bits boolean values
48+
*/
49+
enum MultiBitBool24 {
50+
True = 0x969696;
51+
False = 0x696969;
52+
};
53+
54+
/**
55+
* 28-bits boolean values
56+
*/
57+
enum MultiBitBool28 {
58+
True = 0x6969696;
59+
False = 0x9696969;
60+
};
61+
62+
/**
63+
* 32-bits boolean values
64+
*/
65+
enum MultiBitBool32 {
66+
True = 0x96969696;
67+
False = 0x69696969;
68+
};
69+
70+
/**
71+
* true if hardware uses `re` signal, which is latched signal of software read pulse.
72+
* The standard SystemRDL property `swacc` cannot be used here because `swacc = hwre | swmod`.
73+
*/
74+
property hwre {
75+
type = boolean;
76+
component = reg;
77+
default = false;
78+
};
79+
80+
/* If it is true, the register will be implemented using the prim_subreg_shadow module.
81+
* Shadow registers are a mechanism to guard sensitive registers against this specific
82+
* type of attack. They come at a cost of increased area, and a modified SW interaction.
83+
*/
84+
property shadowed {
85+
type = boolean;
86+
component = reg;
87+
default = false;
88+
};
89+
90+
/* Indicates the register must cross to a different clock domain before use.
91+
* The value shown here should correspond to one of the module’s clocks.
92+
*/
93+
property async_clk {
94+
type = boolean;
95+
component = reg;
96+
default = false;
97+
};
98+
99+
/* If true, integrity bits are passed through directly from the memory.
100+
*/
101+
property integrity_bypass {
102+
type = boolean;
103+
component = mem;
104+
default = false;
105+
};

rtl/ip/gpio/data/gpio.rdl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
addrmap gpio {
2+
reg {
3+
field {
4+
sw=w;
5+
reset = 0;
6+
desc = "Pins.";
7+
} PINS[32] = 0;
8+
} OUT @0x0000;
9+
10+
reg {
11+
field {
12+
sw=r;
13+
reset = 0;
14+
desc = "Pins.";
15+
} PINS[32] = 0;
16+
} IN @0x0004;
17+
18+
reg {
19+
field {
20+
sw=r;
21+
reset = 0;
22+
desc = "DBNC.";
23+
} PINS[32] = 0;
24+
} IN_DBNC @0x0008;
25+
26+
reg {
27+
field {
28+
sw=rw;
29+
reset = 0;
30+
desc = "val";
31+
} PINS[32] = 0;
32+
} OUTPUT_ENABLE @0x000c;
33+
34+
};

0 commit comments

Comments
 (0)