1.field name {
properties
}
bits n;指定域的比特数,如果没有指定,默认为1,该属性只能指定一次
access rw|ro|wo|w1|ru|w1c|rc|a1|a0|other|user0|user1|user2|user3|dc;
指定域的访问属性
read/write rw
read-only ro
write-only wo
write-once w1
read-only, but value updated by the design ru
write a 1 to bitwise-clear w1c
clear on read rc
auto-set by the design a1
auto-cleared by the design a0
other other
user-defined behavior. user0
user1
user2
user3
don’t care dc
如果写某个域导致其他域的内容被修改或一个域的行为取决于另一个域的值,则指定其属性为other,userName或dc.其他的访问模式都是假设各个域是相互独立的。
When using the “vmm_ral_field::mirror()” method with the check
argument specified as vmm_ral::VERB, the mirrored value of
the field is assumed to contain the expected value of the field for
all field modes except don’t-care (dc). If a field is specified as dc,
its mirrored value behaves as if it were a rwfield, but it is never
compared against a value read from the design.
Modeling Fields Using User Defined Behavior. With Other and
UserX Access Types
class STATUS_field_callbacks extends
vmm_ral_field_callbacks;
bit prevent_write;
virtual task post_write(..);
prevent_write = ral_model.PREVENT_WRITE.get();
// If the STATUS field is currently write protected
maintain its previous value in the RAL mirror.
if(prevent_write)
ral_model.STATUS.mirror( , vmm_ral::QUIET);
endtask
endclass