self._decoder = wishbone.Decoder(addr_width=30, data_width=32, granularity=8,
features={"cti", "bte"})
- self.ub = UARTBridge(divisor=868, pins=platform.request("uart", 0))
+ self.ub = UARTBridge(divisor=217, pins=platform.request("uart", 0))
self._arbiter.add(self.ub.bus)
self.ddrphy = DomainRenamer("dramsync")(ECP5DDRPHY(platform.request("ddr3", 0, dir={"dq":"-", "dqs":"-"})))
self._decoder.add(self.ddrphy.bus, addr=ddrphy_addr)
- ddrmodule = MT41K256M16(clk_freq, "1:4")
+ ddrmodule = MT41K256M16(clk_freq, "1:2")
self.dramcore = DomainRenamer("dramsync")(gramCore(
phy=self.ddrphy,
begin
uart_rx <= 1'b1;
$display("[%t] Starting POR",$time);
- #700000; // POR is ~700us
+ #100; // POR is ~700us
$display("[%t] POR complete",$time);
// Software control
wishbone_write(32'h00009000 >> 2, 8'h0C); // DFII_CONTROL_ODT|DFII_CONTROL_RESET_N
#500000;
wishbone_write(32'h00009000 >> 2, 8'h0E); // DFII_CONTROL_ODT|DFII_CONTROL_RESET_N|DFI_CONTROL_CKE
- #500000;
+ #100000;
// Set MR2
wishbone_write(32'h0000900c >> 2, 32'h200); // p0 address
wishbone_write(32'h00009000 >> 2, 8'h01); // DFII_CONTROL_SEL
#2000;
+ wishbone_read(32'h10000000 >> 2, tmp);
+ #2000;
+
// Write
wishbone_write(32'h10000000 >> 2, 32'h12345678);
#10000;
begin
uart_rx <= 1'b0;
- #8680;
+ #2170;
for (i = 0; i < 8; i = i + 1)
begin
uart_rx <= data[i];
- #8680;
+ #2170;
end
uart_rx <= 1'b1;
- #8680;
+ #2170;
end
endtask
for (i = 0; i < 8; i = i+1)
begin
- #8680 data[i] <= uart_tx;
+ #2170 data[i] <= uart_tx;
end
- #8680;
+ #2170;
end
endtask
endmodule