sp_dmem.v 5.44 KB
// sp_dmem.v v1 Frank Berndt
// BB dmem;
// :set tabstop=4

module sp_dmem (
	clk, csb, addr_low, addr_high, di, web, do
);
	input clk;				// synchronous clock;
	input csb;				// chip enable;
	input [7:0] addr_low;	// address;
	input [7:0] addr_high;	// address;
	input [127:0] di;		// write data;
	input [15:0] web;		// write enable;
	output [127:0] do;		// read data;

	// 256x128 with byte enables;

	WBSRAMSHS256W64C3B8 dmem0 (
		.DO63(do[63]),
		.DO62(do[62]),
		.DO61(do[61]),
		.DO60(do[60]),
		.DO59(do[59]),
		.DO58(do[58]),
		.DO57(do[57]),
		.DO56(do[56]),
		.DO55(do[55]),
		.DO54(do[54]),
		.DO53(do[53]),
		.DO52(do[52]),
		.DO51(do[51]),
		.DO50(do[50]),
		.DO49(do[49]),
		.DO48(do[48]),
		.DO47(do[47]),
		.DO46(do[46]),
		.DO45(do[45]),
		.DO44(do[44]),
		.DO43(do[43]),
		.DO42(do[42]),
		.DO41(do[41]),
		.DO40(do[40]),
		.DO39(do[39]),
		.DO38(do[38]),
		.DO37(do[37]),
		.DO36(do[36]),
		.DO35(do[35]),
		.DO34(do[34]),
		.DO33(do[33]),
		.DO32(do[32]),
		.DO31(do[31]),
		.DO30(do[30]),
		.DO29(do[29]),
		.DO28(do[28]),
		.DO27(do[27]),
		.DO26(do[26]),
		.DO25(do[25]),
		.DO24(do[24]),
		.DO23(do[23]),
		.DO22(do[22]),
		.DO21(do[21]),
		.DO20(do[20]),
		.DO19(do[19]),
		.DO18(do[18]),
		.DO17(do[17]),
		.DO16(do[16]),
		.DO15(do[15]),
		.DO14(do[14]),
		.DO13(do[13]),
		.DO12(do[12]),
		.DO11(do[11]),
		.DO10(do[10]),
		.DO9(do[9]),
		.DO8(do[8]),
		.DO7(do[7]),
		.DO6(do[6]),
		.DO5(do[5]),
		.DO4(do[4]),
		.DO3(do[3]),
		.DO2(do[2]),
		.DO1(do[1]),
		.DO0(do[0]),
		.DI63(di[63]),
		.DI62(di[62]),
		.DI61(di[61]),
		.DI60(di[60]),
		.DI59(di[59]),
		.DI58(di[58]),
		.DI57(di[57]),
		.DI56(di[56]),
		.DI55(di[55]),
		.DI54(di[54]),
		.DI53(di[53]),
		.DI52(di[52]),
		.DI51(di[51]),
		.DI50(di[50]),
		.DI49(di[49]),
		.DI48(di[48]),
		.DI47(di[47]),
		.DI46(di[46]),
		.DI45(di[45]),
		.DI44(di[44]),
		.DI43(di[43]),
		.DI42(di[42]),
		.DI41(di[41]),
		.DI40(di[40]),
		.DI39(di[39]),
		.DI38(di[38]),
		.DI37(di[37]),
		.DI36(di[36]),
		.DI35(di[35]),
		.DI34(di[34]),
		.DI33(di[33]),
		.DI32(di[32]),
		.DI31(di[31]),
		.DI30(di[30]),
		.DI29(di[29]),
		.DI28(di[28]),
		.DI27(di[27]),
		.DI26(di[26]),
		.DI25(di[25]),
		.DI24(di[24]),
		.DI23(di[23]),
		.DI22(di[22]),
		.DI21(di[21]),
		.DI20(di[20]),
		.DI19(di[19]),
		.DI18(di[18]),
		.DI17(di[17]),
		.DI16(di[16]),
		.DI15(di[15]),
		.DI14(di[14]),
		.DI13(di[13]),
		.DI12(di[12]),
		.DI11(di[11]),
		.DI10(di[10]),
		.DI9(di[9]),
		.DI8(di[8]),
		.DI7(di[7]),
		.DI6(di[6]),
		.DI5(di[5]),
		.DI4(di[4]),
		.DI3(di[3]),
		.DI2(di[2]),
		.DI1(di[1]),
		.DI0(di[0]),
		.A7(addr_low[7]),
		.A6(addr_low[6]),
		.A5(addr_low[5]),
		.A4(addr_low[4]),
		.A3(addr_low[3]),
		.A2(addr_low[2]),
		.A1(addr_low[1]),
		.A0(addr_low[0]),
		.WEB7(web[7]),
		.WEB6(web[6]),
		.WEB5(web[5]),
		.WEB4(web[4]),
		.WEB3(web[3]),
		.WEB2(web[2]),
		.WEB1(web[1]),
		.WEB0(web[0]),
		.CSB(csb),
		.BE(clk),
		.TBE(1'b0),
		.TEST(1'b0),
		.BUB(1'b1)
	);

	WBSRAMSHS256W64C3B8 dmem1 (
		.DO63(do[127]),
		.DO62(do[126]),
		.DO61(do[125]),
		.DO60(do[124]),
		.DO59(do[123]),
		.DO58(do[122]),
		.DO57(do[121]),
		.DO56(do[120]),
		.DO55(do[119]),
		.DO54(do[118]),
		.DO53(do[117]),
		.DO52(do[116]),
		.DO51(do[115]),
		.DO50(do[114]),
		.DO49(do[113]),
		.DO48(do[112]),
		.DO47(do[111]),
		.DO46(do[110]),
		.DO45(do[109]),
		.DO44(do[108]),
		.DO43(do[107]),
		.DO42(do[106]),
		.DO41(do[105]),
		.DO40(do[104]),
		.DO39(do[103]),
		.DO38(do[102]),
		.DO37(do[101]),
		.DO36(do[100]),
		.DO35(do[99]),
		.DO34(do[98]),
		.DO33(do[97]),
		.DO32(do[96]),
		.DO31(do[95]),
		.DO30(do[94]),
		.DO29(do[93]),
		.DO28(do[92]),
		.DO27(do[91]),
		.DO26(do[90]),
		.DO25(do[89]),
		.DO24(do[88]),
		.DO23(do[87]),
		.DO22(do[86]),
		.DO21(do[85]),
		.DO20(do[84]),
		.DO19(do[83]),
		.DO18(do[82]),
		.DO17(do[81]),
		.DO16(do[80]),
		.DO15(do[79]),
		.DO14(do[78]),
		.DO13(do[77]),
		.DO12(do[76]),
		.DO11(do[75]),
		.DO10(do[74]),
		.DO9(do[73]),
		.DO8(do[72]),
		.DO7(do[71]),
		.DO6(do[70]),
		.DO5(do[69]),
		.DO4(do[68]),
		.DO3(do[67]),
		.DO2(do[66]),
		.DO1(do[65]),
		.DO0(do[64]),
		.DI63(di[127]),
		.DI62(di[126]),
		.DI61(di[125]),
		.DI60(di[124]),
		.DI59(di[123]),
		.DI58(di[122]),
		.DI57(di[121]),
		.DI56(di[120]),
		.DI55(di[119]),
		.DI54(di[118]),
		.DI53(di[117]),
		.DI52(di[116]),
		.DI51(di[115]),
		.DI50(di[114]),
		.DI49(di[113]),
		.DI48(di[112]),
		.DI47(di[111]),
		.DI46(di[110]),
		.DI45(di[109]),
		.DI44(di[108]),
		.DI43(di[107]),
		.DI42(di[106]),
		.DI41(di[105]),
		.DI40(di[104]),
		.DI39(di[103]),
		.DI38(di[102]),
		.DI37(di[101]),
		.DI36(di[100]),
		.DI35(di[99]),
		.DI34(di[98]),
		.DI33(di[97]),
		.DI32(di[96]),
		.DI31(di[95]),
		.DI30(di[94]),
		.DI29(di[93]),
		.DI28(di[92]),
		.DI27(di[91]),
		.DI26(di[90]),
		.DI25(di[89]),
		.DI24(di[88]),
		.DI23(di[87]),
		.DI22(di[86]),
		.DI21(di[85]),
		.DI20(di[84]),
		.DI19(di[83]),
		.DI18(di[82]),
		.DI17(di[81]),
		.DI16(di[80]),
		.DI15(di[79]),
		.DI14(di[78]),
		.DI13(di[77]),
		.DI12(di[76]),
		.DI11(di[75]),
		.DI10(di[74]),
		.DI9(di[73]),
		.DI8(di[72]),
		.DI7(di[71]),
		.DI6(di[70]),
		.DI5(di[69]),
		.DI4(di[68]),
		.DI3(di[67]),
		.DI2(di[66]),
		.DI1(di[65]),
		.DI0(di[64]),
		.A7(addr_high[7]),
		.A6(addr_high[6]),
		.A5(addr_high[5]),
		.A4(addr_high[4]),
		.A3(addr_high[3]),
		.A2(addr_high[2]),
		.A1(addr_high[1]),
		.A0(addr_high[0]),
		.WEB7(web[15]),
		.WEB6(web[14]),
		.WEB5(web[13]),
		.WEB4(web[12]),
		.WEB3(web[11]),
		.WEB2(web[10]),
		.WEB1(web[9]),
		.WEB0(web[8]),
		.CSB(csb),
		.BE(clk),
		.TBE(1'b0),
		.TEST(1'b0),
		.BUB(1'b1)
	);

endmodule