data/full_repos/permissive/174008594/src/ram_32kb.v
1: b"%Error: data/full_repos/permissive/174008594/src/ram_32kb.v:34: Cannot find file containing module: 'SB_SPRAM256KA'\n SB_SPRAM256KA mem (\n ^~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/174008594/src,data/full_repos/permissive/174008594/SB_SPRAM256KA\n             data/full_repos/permissive/174008594/src,data/full_repos/permissive/174008594/SB_SPRAM256KA.v\n             data/full_repos/permissive/174008594/src,data/full_repos/permissive/174008594/SB_SPRAM256KA.sv\n             SB_SPRAM256KA\n             SB_SPRAM256KA.v\n             SB_SPRAM256KA.sv\n             obj_dir/SB_SPRAM256KA\n             obj_dir/SB_SPRAM256KA.v\n             obj_dir/SB_SPRAM256KA.sv\n%Error: Exiting due to 1 error(s)\n"
module RAM_32kB(
    input clk,
    input sel,
    input we,
    input [14:0] addr,
    input [7:0] din,
    output reg [7:0] dout
);

`ifdef SIMULATE
	integer i;
    reg [7:0] memory[0:32767];
	

	initial
		for (i = 0; i < 32768; i = i +1)
			memory[i] <= 0;
    

    always @(posedge clk)
        if(sel & we)
            memory[addr] <= din;
    

    always @(posedge clk)
        dout <= memory[addr];
`else
	wire [15:0] data;
	

	SB_SPRAM256KA mem (
		.ADDRESS(addr[14:1]),
		.DATAIN({din,din}),
		.MASKWREN(addr[0]?4'b1100:4'b0011),
		.WREN(we),
		.CHIPSELECT(sel),
		.CLOCK(clk),
		.STANDBY(1'b0),
		.SLEEP(1'b0),
		.POWEROFF(1'b1),
		.DATAOUT(data)
	);
    

    reg hilo_sel;
    always @(posedge clk)
        hilo_sel <= addr[0];
	
	always @(*)
		dout = hilo_sel ? data[15:8] : data[7:0];
`endif
endmodule
module RAM_32kB(
    input clk,
    input sel,
    input we,
    input [14:0] addr,
    input [7:0] din,
    output reg [7:0] dout
);


`ifdef SIMULATE
	integer i;
    reg [7:0] memory[0:32767];
	

	initial
		for (i = 0; i < 32768; i = i +1)
			memory[i] <= 0;
    

    always @(posedge clk)
        if(sel & we)
            memory[addr] <= din;
    

    always @(posedge clk)
        dout <= memory[addr];
`else
	wire [15:0] data;
	

	SB_SPRAM256KA mem (
		.ADDRESS(addr[14:1]),
		.DATAIN({din,din}),
		.MASKWREN(addr[0]?4'b1100:4'b0011),
		.WREN(we),
		.CHIPSELECT(sel),
		.CLOCK(clk),
		.STANDBY(1'b0),
		.SLEEP(1'b0),
		.POWEROFF(1'b1),
		.DATAOUT(data)
	);
    

    reg hilo_sel;
    always @(posedge clk)
        hilo_sel <= addr[0];
	
	always @(*)
		dout = hilo_sel ? data[15:8] : data[7:0];
`endif
endmodule