sim: Add new ram-load test cases

Adds new test cases to various ram-load related logic.

Signed-off-by: Roland Mikhel <roland.mikhel@arm.com>
Change-Id: I3a0ca951b2c720be4e6fe2ed0e5d1830fcfb240c
diff --git a/sim/src/tlv.rs b/sim/src/tlv.rs
index 99c02d9..5541f11 100644
--- a/sim/src/tlv.rs
+++ b/sim/src/tlv.rs
@@ -112,6 +112,10 @@
 
     /// Set the security counter to the specified value.
     fn set_security_counter(&mut self, security_cnt: Option<u32>);
+
+    /// Sets the ignore_ram_load_flag so that can be validated when it is missing,
+    /// it will not load successfully.
+    fn set_ignore_ram_load_flag(&mut self);
 }
 
 #[derive(Debug, Default)]
@@ -124,6 +128,8 @@
     /// Should this signature be corrupted.
     gen_corrupted: bool,
     security_cnt: Option<u32>,
+    /// Ignore RAM_LOAD flag
+    ignore_ram_load_flag: bool,
 }
 
 #[derive(Debug)]
@@ -318,7 +324,7 @@
     /// Retrieve the header flags for this configuration.  This can be called at any time.
     fn get_flags(&self) -> u32 {
         // For the RamLoad case, add in the flag for this feature.
-        if Caps::RamLoad.present() {
+        if Caps::RamLoad.present() && !self.ignore_ram_load_flag {
             self.flags | (TlvFlags::RAM_LOAD as u32)
         } else {
             self.flags
@@ -793,6 +799,10 @@
     fn set_security_counter(&mut self, security_cnt: Option<u32>) {
         self.security_cnt = security_cnt;
     }
+
+    fn set_ignore_ram_load_flag(&mut self) {
+        self.ignore_ram_load_flag = true;
+    }
 }
 
 include!("rsa_pub_key-rs.txt");