Function & Argument Type(s)
|
Description
|
Example |
checkMemory (String memory_name) returns Boolean |
Checks to see whether the memory (global and local) exists. For global memory, the name is sufficient. For a local memory, the “Model_Name.Hierarchical_Name.local_memory_name” is required. |
Mem_Exists = checkMemory(MyMem) = true |
checkMemory (String Device name, String Field Name) returns Boolean |
Checks to see whether the memory (global and local) containing a Data Structure contains a specific field. For global memory, the name is sufficient. For a local memory, the “Model_Name.Hierarchical_Name.local_memory_name” is required. |
Field_Flag = checkVirtualMemory(MyMem, Priority) = true |
checkVirtualMemory (String Device name) returns Boolean |
Checks to see whether the virtual device exists. The virtual device can be Power Manager, IN, DEMUX, Virtual Machine Scheduler & Smart_Controller. |
Power_Manager_Flag = checkVirtualMemory(Pwr_Mgr) = true |
StringName.check() |
Check if a global or local memory exists before reading it. If the BooleanToken is true, the memory named exists, else false. |
StringName = “My_Global_Memory_Name” BooleanToken = StringName.check() |
StringName.check (Block_Name) |
Check if a block memory exists before reading it. If the BooleanToken is true, the memory named exists, else false. |
StringName = “My_Block_Memory_Name” BooleanToken = StringName.check(Block_Name) |
newMemory (String memory_name, String str) |
Create a new memory with an initial value of 'str'. If str is a string that matches a Data Structure name in $VS/VisualSim/data folder, then the initial value is a Data Structure. If the memory exists, function is ignored. |
newMemory("mem1","Processor_DS") |
readAllMemory() |
Provide a output of all local/global memories and their current values If no memory exists, then returns a data structure with one entry. |
readAllMemory() |
StringName.read() |
Read a global memory using the StringToken directly. |
StringName = “My_Global_Memory_Name” MyMemoryToken = StringName.read() |
StringName.read() |
Read a local memory using the StringToken directly. “local_memory” is a script keyword to get the local memory prefix. It consists of “Model_Name.Hierarchical_Name”, so users can create equivalent local_name for other parts of a model using this notation. |
StringName = local_memory + “My_Local_Memory_Name” MyMemoryToken = StringName.read() |
StringName.read (Block_Name) |
Read a block memory anywhere in the model by appending the desired block name. Block names must be unique in the model so, hierarchical block names can be calculated in StringName. |
StringName = “My_Block_Memory_Name” MyMemoryToken = StringName.read(Block_Name) |
StringName.write (MyToken) |
Write to memory anywhere in the model by appending StringName.write(MyToken). Block level memories can be modified using newValue(). Modifying an internal block operation memory is not preferable, as it can be very difficult to debug. |
StringName =“My_Memory_Name” MyMemoryToken = StringName.write(Token) |