bios: add main bus and csr bus infos, use KiB/GiB.
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 28 May 2020 13:05:24 +0000 (15:05 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 28 May 2020 13:05:24 +0000 (15:05 +0200)
litex/soc/integration/soc.py
litex/soc/software/bios/main.c

index a7f005245cfcce1fa68d99d5319d64c59eab5309..45800d2e8be039e5f34769aba6cd13ac46d77f54 100644 (file)
@@ -644,7 +644,6 @@ class SoCController(Module, AutoCSR):
 class SoC(Module):
     mem_map = {}
     def __init__(self, platform, sys_clk_freq,
-
         bus_standard         = "wishbone",
         bus_data_width       = 32,
         bus_address_width    = 32,
@@ -856,6 +855,9 @@ class SoC(Module):
                 colorer(self.bus_interconnect.__class__.__name__),
                 colorer(len(self.bus.masters)),
                 colorer(len(self.bus.slaves))))
+        self.add_constant("CONFIG_BUS_STANDARD",      self.bus.standard.upper())
+        self.add_constant("CONFIG_BUS_DATA_WIDTH",    self.bus.data_width)
+        self.add_constant("CONFIG_BUS_ADDRESS_WIDTH", self.bus.address_width)
 
         # SoC CSR Interconnect ---------------------------------------------------------------------
         self.submodules.csr_bankarray = csr_bus.CSRBankArray(self,
index 077064459fe161150ec837581bcb3bf98526deec..e2181b76198b7cd281af9ba43c28481fc97e57e3 100644 (file)
@@ -103,13 +103,20 @@ int main(int i, char **c)
        printf("\e[1mCPU\e[0m:       %s @ %dMHz\n",
                CONFIG_CPU_HUMAN_NAME,
                CONFIG_CLOCK_FREQUENCY/1000000);
-       printf("\e[1mROM\e[0m:       %dKB\n", ROM_SIZE/1024);
-       printf("\e[1mSRAM\e[0m:      %dKB\n", SRAM_SIZE/1024);
+       printf("\e[1mBUS\e[0m:       %s %d-bit / %dGiB\n",
+               CONFIG_BUS_STANDARD,
+               CONFIG_BUS_DATA_WIDTH,
+               (1 << (CONFIG_BUS_ADDRESS_WIDTH - 30)));
+       printf("\e[1mCSR\e[0m:       %d-bit / %d-bit aligned\n",
+               CONFIG_CSR_DATA_WIDTH,
+               CONFIG_CSR_ALIGNMENT);
+       printf("\e[1mROM\e[0m:       %dKiB\n", ROM_SIZE/1024);
+       printf("\e[1mSRAM\e[0m:      %dKiB\n", SRAM_SIZE/1024);
 #ifdef CONFIG_L2_SIZE
-       printf("\e[1mL2\e[0m:        %dKB\n", CONFIG_L2_SIZE/1024);
+       printf("\e[1mL2\e[0m:        %dKiB\n", CONFIG_L2_SIZE/1024);
 #endif
 #ifdef MAIN_RAM_SIZE
-       printf("\e[1mMAIN-RAM\e[0m:  %dKB\n", MAIN_RAM_SIZE/1024);
+       printf("\e[1mMAIN-RAM\e[0m:  %dKiB\n", MAIN_RAM_SIZE/1024);
 #endif
        printf("\n");