morningyue Posted June 28, 2011 Report Share Posted June 28, 2011 hello I got a issue when I want to do byte enable access in my register. My register model is 64bits width and it has several fields inside as following: class reg_reg_R extends uvm_reg; rand uvm_reg_field F1; rand uvm_reg_field F2; rand uvm_reg_field F3; rand uvm_reg_field F4; function new(string name = "R"); super.new(name, 64, UVM_NO_COVERAGE); endfunction: new virtual function void build(); this.F1 = uvm_reg_field::type_id::create("F1"); this.F1.configure(this, 8, 0, "RW", 0, 8'h0, 1, 0, 1); this.F2 = uvm_reg_field::type_id::create("F2"); this.F2.configure(this, 8, 16, "RW", 0, 8'h0, 1, 0, 1); this.F3 = uvm_reg_field::type_id::create("F3"); this.F3.configure(this, 8, 24, "RW", 0, 8'h0, 1, 0, 1); this.F4 = uvm_reg_field::type_id::create("F4"); this.F4.configure(this, 8, 56, "RW", 0, 8'h0, 1, 0, 1); endfunction: build `uvm_object_utils(reg_reg_R) endclass : reg_reg_R My register map access width in 1 byte APB = create_map("APB", 'h0, 1, UVM_LITTLE_ENDIAN); default_map = APB; rand reg_reg_R A; APB.add_reg(A, 'h0, "RW"); I also set register layer adapter "supports_byte_enable = 1" to allow byte access. my sequence only send 1 write request to register field F3. model.A.F3.write(status, 'h33, .parent(this)); From result I found not only field "F3" (byte 3) has been written with data 'h33, byte 4, byte5, byte6, byte7 also have been written with data 'h0. And function "reg2bus" inside register adapter has been called 5 times not only once. How can I do specific byte operation in register w/o accessing other fields? Thanks! Quote Link to comment Share on other sites More sharing options...
janick Posted June 29, 2011 Report Share Posted June 29, 2011 Given the information you have supplied, it should work. Can you provide a complete testcase? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.