This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Increasizing RAM size in AFM

Hi, I want to increase RAM size from 2^32 bits to 2^48 bits. I made the change in RAM_Device.lisa file by changing as    

resources
    {
        PARAMETER { description("Memory Size"), default(0x1000000000000), type(uint64_t) }  size;
        PARAMETER { description("Global monitor ignores non-exclusive stores"),
                    default(false), type(bool), publish(false) }  global_monitor_ignores_non_ex_store;

        MEMORY { virtual(true), read_function(debug_read), write_function(debug_write) } ram_contents[0x100000000000000];
    }

  Still it throws fault if I access range more than 2^32. Please suggest if I am missing something.

  • I would advise against changing the LISA+ code of the base peripheral for changes like this...

    What your edit did was to change the default size.  If the instantiation of the RAMDevice component specified a size, that would override the default.  For example:

    component my_system
    {
      composition
      {
        ...
        ram0 : RAMDevice();
        ram1 : RAMDevice(size=0x100000000);
        ....
      }
      ...
    }
    

    In the above example, ram0 would inherit the default size (so 0x1000000000000), while ram1 would only have a size of 0x100000000.

    NOTE: Parameters can also be set at the launch of simulation.

    The other thing to consider is address mapping.  What you've done is set the size of the memory itself.  What you will also need to do is make sure the correct address range is directed to the peripheral.

    For example:

    component my_system
    {
       ...
       connection
      {
         BusDecoder.pvbus_m_range[0x0..0x0FFF] => ram0.pvbus;
         BusDecoder.pvbus_m_range[0x1000..0x1FFF] => ram1.pvbus;
      }
      ..
    }
    

    In the above example we've mapped the address range 0x0-0x0FFF to ram0, and 0x1000-0x1FFF to ram1.

    Earlier we specified the size the of RAMs they model, but in each case we've only actually mapped 0x1000 bytes of address space to them!  If we wanted to be able access all the memory in ram0 we'd need to allocate it a larger address range.

    EDIT: Applying code style to the examples.