module bram1 #( parameter ABITS = 8, DBITS = 8, TRANSP = 0 ) ( input clk, input [ABITS-1:0] WR_ADDR, input [DBITS-1:0] WR_DATA, input WR_EN, input [ABITS-1:0] RD_ADDR, output [DBITS-1:0] RD_DATA ); localparam [ABITS-1:0] INIT_ADDR_0 = 1234; localparam [ABITS-1:0] INIT_ADDR_1 = 4321; localparam [ABITS-1:0] INIT_ADDR_2 = 2**ABITS-1; localparam [ABITS-1:0] INIT_ADDR_3 = (2**ABITS-1) / 2; localparam [DBITS-1:0] INIT_DATA_0 = 128'h 51e152a7300e309ccb8cd06d34558f49; localparam [DBITS-1:0] INIT_DATA_1 = 128'h 07b1fe94a530ddf3027520f9d23ab43e; localparam [DBITS-1:0] INIT_DATA_2 = 128'h 3cedc6de43ef3f607af3193658d0eb0b; localparam [DBITS-1:0] INIT_DATA_3 = 128'h f6bc5514a8abf1e2810df966bcc13b46; reg [DBITS-1:0] memory [0:2**ABITS-1]; reg [ABITS-1:0] RD_ADDR_BUF; reg [DBITS-1:0] RD_DATA_BUF; initial begin memory[INIT_ADDR_0] <= INIT_DATA_0; memory[INIT_ADDR_1] <= INIT_DATA_1; memory[INIT_ADDR_2] <= INIT_DATA_2; memory[INIT_ADDR_3] <= INIT_DATA_3; end always @(posedge clk) begin if (WR_EN) memory[WR_ADDR] <= WR_DATA; RD_ADDR_BUF <= RD_ADDR; RD_DATA_BUF <= memory[RD_ADDR]; end assign RD_DATA = TRANSP ? memory[RD_ADDR_BUF] : RD_DATA_BUF; endmodule r> aboutsummaryrefslogtreecommitdiffstats
path: root/docs/internals_midi_util.md
blob: 97821bd18063a908d807da8bd58a4578f751665b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# group `midi_util` {#group__midi__util}

## Summary

 Members                        | Descriptions                                
--------------------------------|---------------------------------------------
`enum `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e)            | An enumeration of the possible packet length values.
`public bool `[`midi_is_statusbyte`](#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5)`(uint8_t theByte)`            | Test to see if the byte given is a status byte.
`public bool `[`midi_is_realtime`](#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7)`(uint8_t theByte)`            | Test to see if the byte given is a realtime message.
`public `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e)` `[`midi_packet_length`](#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175)`(uint8_t status)`            | Find the length of the packet associated with the status byte given.

## Members

#### `enum `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e) {#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e}

 Values                         | Descriptions                                
--------------------------------|---------------------------------------------
UNDEFINED            | 
ONE            | 
TWO            | 
THREE            | 

An enumeration of the possible packet length values.

#### `public bool `[`midi_is_statusbyte`](#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5)`(uint8_t theByte)` {#group__midi__util_1ga12e3b42ff9cbb4b4f2bc455fc8743ee5}

Test to see if the byte given is a status byte.

#### Parameters
* `theByte` the byte to test 

#### Returns
true if the byte given is a midi status byte

#### `public bool `[`midi_is_realtime`](#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7)`(uint8_t theByte)` {#group__midi__util_1gad2f52c363e34a8000d80c983c324e2d7}

Test to see if the byte given is a realtime message.

#### Parameters
* `theByte` the byte to test 

#### Returns
true if it is a realtime message, false otherwise

#### `public `[`midi_packet_length_t`](#group__midi__util_1gae29ff56aee2b430ffe53933b97e5e79e)` `[`midi_packet_length`](#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175)`(uint8_t status)` {#group__midi__util_1gaa168b43af6ae9de0debce1625e4b8175}

Find the length of the packet associated with the status byte given.

#### Parameters
* `status` the status byte 

#### Returns
the length of the packet, will return UNDEFINED if the byte is not a status byte or if it is a sysex status byte