Task #6187
closed
Support for address object declaration
Added by Alexander Kamkin over 9 years ago.
Updated over 9 years ago.
Category:
Template Processor
Published in build:
2.2.11
Description
Address object includes the following attributes:
- Name (optional)
- VA, PA (optional) and other properties.
Further, address objects could be used as parameters of a special test situation access
.
- Status changed from New to Open
- % Done changed from 0 to 10
First sketch - r4431
Second sketch - r4433, r4434, r4435, r4436
First implementation without access mode - r4441, r4442
First implementation with access mode - r4445, r4446, r4447, r4448.
- % Done changed from 10 to 40
- % Done changed from 40 to 70
Example demonstrating how to use new test template facilities:
class MemoryObjectTemplate < MiniMipsBaseTemplate
def pre
super
data {
org 0x00010000
label :label
word rand(0, 9)
}
end
def run
# Attributes:
#
# 1. name [optional] : String or Symbol
# 2. size [compulsory] : Integer, size int bytes, must be a power of 2
# 3. mode [optional] : String "rwx", access mode, by default is "r--"
# 4. va [compulsory] : address | address1..address2 | label
# 5. pa [compulsory] : address | address1..address2 | region
# 6. data [optional] : Integer
#
# NOTE: If va is specified as label, pa is not used and is set to null.
mo1 = memory_object(
:va => 0x0002000, :pa => 0x000F000, :size => 32,:data => 0xDEADBEEF)
mo2 = memory_object(
:name=> :mo2, :mode => "rw-", :va => 0x0002000, :pa => 0x000F000, :size => 32)
mo3 = memory_object(
:va => :label, :size => 32)
mo4 = memory_object(
:va => 0x000A000..0x000F000, :pa => 0x000F000, :size => 64)
mo5 = memory_object(
:va => 0x0002000, :pa => "data", :size => 32)
end
end
- Status changed from Open to Resolved
- % Done changed from 70 to 100
- Status changed from Resolved to Closed
- Published in build set to 2.2.11
Also available in: Atom
PDF