summaryrefslogtreecommitdiff
path: root/hdl/defs.svh
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-02-27 17:21:05 -0800
committerJulian Blake Kongslie2022-02-27 17:21:05 -0800
commit0553c4839c06011bd044f69b4913e5c793fdd2ec (patch)
treed11e69863532621fe1fa55cc7e8aa2a8cfa3b727 /hdl/defs.svh
downloadmultipdp8-0553c4839c06011bd044f69b4913e5c793fdd2ec.tar.xz
Initial commit.
Diffstat (limited to 'hdl/defs.svh')
-rw-r--r--hdl/defs.svh58
1 files changed, 58 insertions, 0 deletions
diff --git a/hdl/defs.svh b/hdl/defs.svh
new file mode 100644
index 0000000..ea8dbc1
--- /dev/null
+++ b/hdl/defs.svh
@@ -0,0 +1,58 @@
1`define RAM_ADDRESS_BITS 23
2`define RAM_BYTE_BITS 8
3`define RAM_WORD_BYTES 2
4`define RAM_LINE_WORDS 1
5
6`define PDP_ADDRESS_BITS 15
7
8`define UART_BYTE_BITS 8
9
10`define TAG_BITS 1
11
12typedef bit [`RAM_ADDRESS_BITS-1:0] ram_word_address_t;
13typedef bit [`RAM_ADDRESS_BITS-1:$clog2(`RAM_LINE_WORDS)] ram_line_address_t;
14typedef bit [`RAM_BYTE_BITS-1:0] ram_byte_t;
15typedef ram_byte_t [`RAM_WORD_BYTES-1:0] ram_word_t;
16typedef ram_word_t [`RAM_LINE_WORDS-1:0] ram_line_t;
17typedef bit [$clog2(`RAM_WORD_BYTES):0] ram_word_mask_t;
18typedef ram_word_mask_t [`RAM_LINE_WORDS-1:0] ram_line_mask_t;
19
20typedef bit [$clog2(`RAM_WORD_BYTES+1):0] ram_byte_count_t;
21typedef bit [$clog2(`RAM_LINE_WORDS+1):0] ram_word_count_t;
22
23typedef bit [`RAM_ADDRESS_BITS-1:`PDP_ADDRESS_BITS] ram_pdp_address_space_t;
24
25typedef bit [`PDP_ADDRESS_BITS-1:0] pdp_word_address_t;
26typedef bit [`PDP_ADDRESS_BITS-1:$clog2(`RAM_LINE_WORDS)] pdp_line_address_t;
27
28typedef bit [`TAG_BITS-1:0] tag_t;
29
30typedef bit [`UART_BYTE_BITS-1:0] uart_byte_t;
31
32typedef struct {
33 ram_line_address_t address;
34 bit write;
35 ram_line_t data;
36 ram_line_mask_t mask;
37 tag_t tag;
38} ram_command_t;
39
40typedef struct {
41 ram_line_address_t address;
42 ram_line_t data;
43 tag_t tag;
44} ram_read_response_t;
45
46typedef struct {
47 pdp_line_address_t address;
48 bit write;
49 ram_line_t data;
50 ram_line_mask_t mask;
51 tag_t tag;
52} pdp_command_t;
53
54typedef struct {
55 pdp_line_address_t address;
56 ram_line_t data;
57 tag_t tag;
58} pdp_read_response_t;