Skip to content

AttributeError: object 'VExpress_GEM5_V1_Base' has no attribute 'uart' #20

Open
@cirosantilli2

Description

@cirosantilli2

Trying to run baremetal with VExpress_GEM5_V1_Base with:

 '/home/ciro/bak/git/newlib-examples/out/arm/gem5/build/ARM/gem5.opt' \
-d '/home/ciro/bak/git/newlib-examples/out/arm/gem5/m5out' \
--debug-file=trace.txt \
--debug-flags='Exec' \
'/home/ciro/bak/git/newlib-examples/gem5/configs/example/fs.py' \
--bare-metal \
--disk-image='/home/ciro/bak/git/newlib-examples/out/fake.iso' \
--kernel='/home/ciro/bak/git/newlib-examples/out/arm/samples/test.elf' \
--machine-type=VExpress_GEM5_V1_Base \
--mem-size=256MB \

fails with:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ciro/bak/git/newlib-examples/gem5/src/python/m5/main.py", line 435, in main
    exec filecode in scope
  File "/home/ciro/bak/git/newlib-examples/gem5/configs/example/fs.py", line 344, in <module>
    test_sys = build_test_system(np)
  File "/home/ciro/bak/git/newlib-examples/gem5/configs/example/fs.py", line 109, in build_test_system
    security=options.enable_security_extensions)
  File "/home/ciro/bak/git/newlib-examples/gem5/configs/common/FSConfig.py", line 307, in makeArmSystem
    self.realview.uart.end_on_eot = True
  File "/home/ciro/bak/git/newlib-examples/gem5/src/python/m5/SimObject.py", line 1142, in __getattr__
    raise AttributeError, err_string
AttributeError: object 'VExpress_GEM5_V1_Base' has no attribute 'uart'
  (C++ object is not yet constructed, so wrapped C++ methods are unavailable.)

Works for:

--machine-type=RealView_PBX \\

Then if I hack:

diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index 17498c42b..d555fa0d9 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -304,7 +304,7 @@ def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None,
 
     if bare_metal:
         # EOT character on UART will end the simulation
-        self.realview.uart.end_on_eot = True
+        self.realview.uart0.end_on_eot = True
     else:
         if machine_type in default_kernels:
             self.kernel = binary(default_kernels[machine_type])

it now fails with:

Global frequency set at 1000000000000 ticks per second              
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (256 Mbytes)
warn: Empty .text segment in '/home/ciro/bak/git/newlib-examples/out/arm/samples/test.elf'. ELF file corrupted?                                                                                                    
info: kernel located at: /home/ciro/bak/git/newlib-examples/out/arm/samples/test.elf                                                                                                                               
system.vncserver: Listening for connections on port 5900                             
system.terminal: Listening for connections on port 3456
0: system.remote_gdb: listening for remote gdb on port 7000
**** REAL SIMULATION ****                                                                      
warn: Existing EnergyCtrl, but no enabled DVFSHandler found.                                                   
info: Entering event queue @ 0.  Starting simulation...                             
^CExiting @ tick 215662000 because user interrupt received
~/bak/git/newlib-examples                              

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions