<' struct structs_units5 { addr : byte; rd_wr: bool; when TRUE'rd_wr structs_units5 { data : byte; }; }; // Short Way to extend subtype extend TRUE'rd_wr structs_units5 { write_delay : uint; }; // Second natual way to extend subtype extend structs_units5 { when TRUE'rd_wr structs_units5 { no_writes : byte; keep no_writes < 10; keep write_delay < 10; }; }; extend sys { obj : structs_units5; // This method shows a sub type can accessed print_obj () is { if (obj.rd_wr == TRUE) { out ("Access Type is : Write"); outf("Access Address is : %x\n", obj.addr); outf("Access Data is : %x\n", obj.as_a(TRUE'rd_wr structs_units5).data); outf("Access write_delay is : %x\n",obj. as_a(TRUE'rd_wr structs_units5).write_delay); outf("Access no_writes is : %x\n",obj. as_a(TRUE'rd_wr structs_units5).no_writes); } else { out ("Access Type is : Read"); outf("Access Address is : %x\n",obj.addr); }; }; // Just generate the obj and print it run() is also { for {var i : int = 0; i < 2; i = i + 1} do { gen obj; print_obj(); }; }; }; '>