Fixup on rom_sd flowchart
All checks were successful
ci/woodpecker/push/test-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/test-workflow Pipeline was successful
This commit is contained in:
parent
0015a0d7bc
commit
2387fdbe3b
@ -5,13 +5,13 @@ module sd(
|
|||||||
input logic reset,
|
input logic reset,
|
||||||
output logic ready,
|
output logic ready,
|
||||||
|
|
||||||
audio_buffer_interface.driver audio_buffer
|
audio_buffer_interface.driver buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
// First we write 2048B into the memory buffer, then signal to play it and
|
// First we write 2048B into the memory buffer, then signal to play it and
|
||||||
// wait for half signal to avoid overwriting memory
|
// wait for half signal to avoid overwriting memory
|
||||||
logic initializing;
|
logic initializing;
|
||||||
logic [16:0] rom_address;
|
logic [16:0] rom_addr;
|
||||||
logic [7:0] rom_data;
|
logic [7:0] rom_data;
|
||||||
logic rom_enable;
|
logic rom_enable;
|
||||||
// Keep track of pipeline delay so we don't write garbage into the buffer
|
// Keep track of pipeline delay so we don't write garbage into the buffer
|
||||||
@ -26,7 +26,7 @@ assign ready = '1;
|
|||||||
always_ff @(posedge clk) begin
|
always_ff @(posedge clk) begin
|
||||||
if (reset) begin
|
if (reset) begin
|
||||||
delay <= 1;
|
delay <= 1;
|
||||||
rom_address <= 0;
|
rom_addr <= 0;
|
||||||
initializing <= 1;
|
initializing <= 1;
|
||||||
audio_buffer.addra <= 0;
|
audio_buffer.addra <= 0;
|
||||||
audio_buffer.ena <= 0;
|
audio_buffer.ena <= 0;
|
||||||
@ -36,7 +36,7 @@ always_ff @(posedge clk) begin
|
|||||||
case (delay)
|
case (delay)
|
||||||
1: delay <= 0;
|
1: delay <= 0;
|
||||||
0: begin
|
0: begin
|
||||||
rom_address <= 1;
|
rom_addr <= 1;
|
||||||
delay <= 0;
|
delay <= 0;
|
||||||
initializing <= 0;
|
initializing <= 0;
|
||||||
end
|
end
|
||||||
@ -87,7 +87,7 @@ xpm_memory_sprom #(
|
|||||||
)
|
)
|
||||||
xpm_memory_sprom_inst (
|
xpm_memory_sprom_inst (
|
||||||
.douta(rom_data), // READ_DATA_WIDTH_A-bit output: Data output for port A read operations.
|
.douta(rom_data), // READ_DATA_WIDTH_A-bit output: Data output for port A read operations.
|
||||||
.addra(rom_address), // ADDR_WIDTH_A-bit input: Address for port A read operations.
|
.addra(rom_addr), // ADDR_WIDTH_A-bit input: Address for port A read operations.
|
||||||
.clka(clk), // 1-bit input: Clock signal for port A.
|
.clka(clk), // 1-bit input: Clock signal for port A.
|
||||||
.ena(rom_enable), // 1-bit input: Memory enable signal for port A. Must be high on clock
|
.ena(rom_enable), // 1-bit input: Memory enable signal for port A. Must be high on clock
|
||||||
// cycles when read operations are initiated. Pipelined internally.
|
// cycles when read operations are initiated. Pipelined internally.
|
||||||
|
|||||||
@ -1,23 +1,23 @@
|
|||||||
digraph rom_sd {
|
digraph rom_sd {
|
||||||
Reset [shape = doublecircle, label = "RESET\nbuffer_half = 0\nrom_address = 0\nrom_enable = 1\nbuf.addr=0\nready=0"];
|
Reset [shape = doublecircle, label = "RESET\nbuffer_half = 0\nrom_addr = 0\nrom_enable = 1\nbuffer.addra=0\nready=0"];
|
||||||
node [shape = circle];
|
node [shape = circle];
|
||||||
Delay [label="DELAY\nrom_address++"];
|
Delay [label="DELAY\nrom_addr++"];
|
||||||
WriteBuf [label="WRITEBUF\nbuf.ena=1\nbuf.data=rom_data\nbuf.addr++\nrom_addr++"];
|
WriteBuf [label="WRITEBUF\nbuffer.ena=1\nbuffer.dina=rom_data\nbuffer.addra++\nrom_addr++"];
|
||||||
EndWrite [label="ENDWRITE\nbuf.ena=1\nbuf.data=rom_data\nbuf.addr++\nready=1"];
|
EndWrite [label="ENDWRITE\nbuffer.ena=1\nbuffer.data=rom_data\nbuffer.addra++\nready=1"];
|
||||||
Wait [label = "WAIT\nbuf.ena=0"];
|
Wait [label = "WAIT\nbuffer.ena=0"];
|
||||||
|
|
||||||
Reset -> Reset [label="reset"];
|
Reset -> Reset [label="reset"];
|
||||||
Reset -> Delay [label="!reset"];
|
Reset -> Delay [label="!reset"];
|
||||||
|
|
||||||
Delay -> WriteBuf;
|
Delay -> WriteBuf;
|
||||||
|
|
||||||
WriteBuf -> WriteBuf [label="buf.addr < 1023"]
|
WriteBuf -> WriteBuf [label="buffer.addra < 1023"]
|
||||||
WriteBuf -> EndWrite [label="buf.addr == 1023"]
|
WriteBuf -> EndWrite [label="buffer.addra == 1023"]
|
||||||
|
|
||||||
EndWrite -> Wait;
|
EndWrite -> Wait;
|
||||||
|
|
||||||
Wait -> Wait [label = "buffer_half == buf.address_half"]
|
Wait -> Wait [label = "buffer_half == buffer.address_half"]
|
||||||
Wait -> Delay [label = "buffer_half != buf.address_half"]
|
Wait -> Delay [label = "buffer_half != buffer.address_half"]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
doc/rom_sd.png
BIN
doc/rom_sd.png
Binary file not shown.
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 113 KiB |
Loading…
x
Reference in New Issue
Block a user