|
Lines 32-38
SoCCSRHandler.supported_address_width.append(12)
Link Here
|
| 32 |
# LibreSoCSim ----------------------------------------------------------------- |
32 |
# LibreSoCSim ----------------------------------------------------------------- |
| 33 |
|
33 |
|
| 34 |
class LibreSoCSim(SoCSDRAM): |
34 |
class LibreSoCSim(SoCSDRAM): |
| 35 |
def __init__(self, cpu="libresoc", debug=False, with_sdram=True, |
35 |
def __init__(self, cpu="libresoc", variant="standardjtag", debug=False, |
|
|
36 |
with_sdram=True, |
| 36 |
sdram_module = "AS4C16M16", |
37 |
sdram_module = "AS4C16M16", |
| 37 |
#sdram_data_width = 16, |
38 |
#sdram_data_width = 16, |
| 38 |
#sdram_module = "MT48LC16M16", |
39 |
#sdram_module = "MT48LC16M16", |
|
Lines 43-56
class LibreSoCSim(SoCSDRAM):
Link Here
|
| 43 |
platform = Platform() |
44 |
platform = Platform() |
| 44 |
sys_clk_freq = int(100e6) |
45 |
sys_clk_freq = int(100e6) |
| 45 |
|
46 |
|
| 46 |
#cpu_data_width = 32 |
|
|
| 47 |
cpu_data_width = 64 |
| 48 |
|
| 49 |
if cpu_data_width == 32: |
| 50 |
variant = "standard32" |
| 51 |
else: |
| 52 |
variant = "standardjtag" |
| 53 |
|
| 54 |
#ram_fname = "/home/lkcl/src/libresoc/microwatt/" \ |
47 |
#ram_fname = "/home/lkcl/src/libresoc/microwatt/" \ |
| 55 |
# "hello_world/hello_world.bin" |
48 |
# "hello_world/hello_world.bin" |
| 56 |
#ram_fname = "/home/lkcl/src/libresoc/microwatt/" \ |
49 |
#ram_fname = "/home/lkcl/src/libresoc/microwatt/" \ |
|
Lines 124-129
class LibreSoCSim(SoCSDRAM):
Link Here
|
| 124 |
ics_region = SoCRegion(origin=ics_addr, size=0x1000, cached=False) |
117 |
ics_region = SoCRegion(origin=ics_addr, size=0x1000, cached=False) |
| 125 |
self.bus.add_slave(name='ics', slave=ics_wb, region=ics_region) |
118 |
self.bus.add_slave(name='ics', slave=ics_wb, region=ics_region) |
| 126 |
|
119 |
|
|
|
120 |
if "gpio" in variant: |
| 127 |
# Simple GPIO peripheral |
121 |
# Simple GPIO peripheral |
| 128 |
gpio_addr = self.mem_map['gpio'] |
122 |
gpio_addr = self.mem_map['gpio'] |
| 129 |
gpio_wb = self.cpu.simple_gpio |
123 |
gpio_wb = self.cpu.simple_gpio |
|
Lines 451-456
def main():
Link Here
|
| 451 |
parser = argparse.ArgumentParser(description="LiteX LibreSoC CPU Sim") |
445 |
parser = argparse.ArgumentParser(description="LiteX LibreSoC CPU Sim") |
| 452 |
parser.add_argument("--cpu", default="libresoc", |
446 |
parser.add_argument("--cpu", default="libresoc", |
| 453 |
help="CPU to use: libresoc (default) or microwatt") |
447 |
help="CPU to use: libresoc (default) or microwatt") |
|
|
448 |
parser.add_argument("--variant", default="standardjtag", |
| 449 |
help="Specify variant with different features") |
| 454 |
parser.add_argument("--debug", action="store_true", |
450 |
parser.add_argument("--debug", action="store_true", |
| 455 |
help="Enable debug traces") |
451 |
help="Enable debug traces") |
| 456 |
parser.add_argument("--trace", action="store_true", |
452 |
parser.add_argument("--trace", action="store_true", |
|
Lines 466-472
def main():
Link Here
|
| 466 |
sim_config.add_module("jtagremote", "jtag", args={'port': 44853}) |
462 |
sim_config.add_module("jtagremote", "jtag", args={'port': 44853}) |
| 467 |
|
463 |
|
| 468 |
for i in range(2): |
464 |
for i in range(2): |
| 469 |
soc = LibreSoCSim(cpu=args.cpu, debug=args.debug) |
465 |
soc = LibreSoCSim(cpu=args.cpu, debug=args.debug, variant=args.variant) |
| 470 |
builder = Builder(soc,compile_gateware = i!=0) |
466 |
builder = Builder(soc,compile_gateware = i!=0) |
| 471 |
builder.build(sim_config=sim_config, |
467 |
builder.build(sim_config=sim_config, |
| 472 |
run = i!=0, |
468 |
run = i!=0, |