3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-30 15:00:26 +00:00

Add test cases for co-simulation

This commit is contained in:
Miodrag Milanovic 2022-02-02 13:22:44 +01:00
parent 4a30c9cb94
commit 7ef6da4c7d
7 changed files with 953 additions and 0 deletions

31
tests/sat/grom_computer.v Normal file
View file

@ -0,0 +1,31 @@
module grom_computer
(input clk, // Main Clock
input reset, // reset
output hlt,
output reg[7:0] display_out
);
wire [11:0] addr;
wire [7:0] memory_out;
wire [7:0] memory_in;
wire mem_enable;
wire we;
wire ioreq;
grom_cpu cpu(.clk(clk),.reset(reset),.addr(addr),.data_in(memory_out),.data_out(memory_in),.we(we),.ioreq(ioreq),.hlt(hlt));
assign mem_enable = we & ~ioreq;
ram_memory memory(.clk(clk),.addr(addr),.data_in(memory_in),.we(mem_enable),.data_out(memory_out));
always @(posedge clk)
begin
if(ioreq==1 && we==1)
begin
display_out <= memory_in;
`ifdef DISASSEMBLY
$display("Display output : %h", memory_in);
`endif
end
end
endmodule