Jump to content

JESSO JOSE

Members
  • Content count

    1
  • Joined

  • Last visited

About JESSO JOSE

  • Rank
    Member
  • Birthday 06/29/1990

Profile Information

  • Gender
    Male
  • Location
    TRIVANDRUM
  1. JESSO JOSE

    problem in if statement

    gud mng all, In my systemverilog code, i have used if statement for giving different values to PWDATA in post randamization function. but only the first value is taken. i.e 32'hff300. but the select value is changing, but it does not get the PWDATA value. i am attaching the code here. pls help me to find me the error class my_seq_item_apb extends uvm_sequence_item; rand bit [15:0] PADDR; rand bit [31:0] PWDATA; rand bit [1:0] mem_select; rand bit [5:0] select; constraint PADDR_mem { PADDR inside { 16'h00, 16'h04,16'h08, 16'h0c,16'h10, 16'h14,16'h18, 16'h1c,16'h20,16'h24, 16'h28,16'h2c, 16'h30,16'h34, 16'h38,16'h3c, 16'h40,16'h44, 16'h48,16'h4c,16'h50, 16'h54,16'h58, 16'h5c,16'h60, 16'h64,16'h68, 16'h6c,16'h70 }; if(mem_select==2'b00) { PADDR inside{16'h20,16'h24, 16'h28, 16'h30,16'h34} }; else if (mem_select==2'b01) { PADDR inside {16'h20,16'h4C, 16'h3C, 16'h58,16'h5C} }; else if (mem_select==2'b10) { PADDR inside {16'h20,16'h60, 16'h64, 16'h6C,16'h70} }; else if (mem_select==2'b11) { PADDR inside {16'h20,16'h38, 16'h50, 16'h44,16'h48} }; } `uvm_object_utils_begin(my_seq_item_apb) `uvm_field_int(PADDR, UVM_ALL_ON) `uvm_field_int(PWDATA, UVM_ALL_ON) `uvm_field_int(PRDATA, UVM_ALL_ON) `uvm_field_int(mem_select, UVM_ALL_ON) `uvm_field_int(PWRITE, UVM_ALL_ON) `uvm_object_utils_end function new (string name = "my_seq_item_apb"); super.new(name); endfunction : new function void post_randomize(); if (PADDR == 16'h20) PWDATA[0] = 1'b1; else if (PADDR == 16'h30 | PADDR ==16'h44 | PADDR ==16'h58 | PADDR ==16'h6c) begin if (select==6'b000000 | 6'b110001 | 6'b110010 | 6'b110011 | 6'b110100) begin PWDATA[31:12] = 32'hff300; end else if(select == 6'b000001 | 6'b110101 | 6'b110111 | 6'b111000 | 6'b111001) begin PWDATA[31:12] = 32'hff380; end else if(select == 6'b000010 | 6'b111011 | 6'b111100 | 6'b111101) begin PWDATA[31:12] = 32'hff340; end else if(select == 6'b000011) begin PWDATA[31:12] = 32'hff3c0; end else if(select == 6'b000100) begin PWDATA[31:12] = 32'hff301; end else if(select == 6'b000101) begin PWDATA[31:12] = 32'hff381; end else if(select == 6'b000110) begin PWDATA[31:12] = 32'hff341; end else if(select == 6'b000111) begin PWDATA[31:12] = 32'hff3c1; end else if(select == 6'b001000) begin PWDATA[31:12] = 32'hff302; end else if(select == 6'b001001) begin PWDATA[31:12] = 32'hff382; end else if(select == 6'b001010) begin PWDATA[31:12] = 32'hff342; end else if(select == 6'b001011) begin PWDATA[31:12] = 32'hff3c2; end else if(select == 6'b001100) begin PWDATA[31:12] = 32'hff308; end else if(select == 6'b001101) begin PWDATA[31:12] = 32'hff388; end else if(select == 6'b001110) begin PWDATA[31:12] = 32'hff348; end else if(select == 6'b001111) begin PWDATA[31:12] = 32'hff3c8; end else if(select == 6'b010000) begin PWDATA[31:12] = 32'hff309; end else if(select == 6'b010001) begin PWDATA[31:12] = 32'hff389; end else if(select == 6'b010010) begin PWDATA[31:12] = 32'hff349; end else if(select == 6'b010011) begin PWDATA[31:12] = 32'hff3c9; end else if(select == 6'b010100) begin PWDATA[31:12] = 32'hff30a; end else if(select == 6'b010101) begin PWDATA[31:12] = 32'hff38a; end else if(select == 6'b010110) begin PWDATA[31:12] = 32'hff34a; end else if(select == 6'b010111) begin PWDATA[31:12] = 32'hff3ca; end else if(select == 6'b011000) begin PWDATA[31:12] = 32'hff310; end else if(select == 6'b011001) begin PWDATA[31:12] = 32'hff350; end else if(select == 6'b011010) begin PWDATA[31:12] = 32'hff390; end else if(select == 6'b011011) begin PWDATA[31:12] = 32'hff3c9; end else if(select == 6'b11100) begin PWDATA[31:12] = 32'hff3d0; end else if(select == 5'b011101) begin PWDATA[31:12] = 32'hff312; end else if(select == 6'b011110) begin PWDATA[31:12] = 32'hff352; end else if(select == 6'b011111) begin PWDATA[31:12] = 32'hff392; end else if (select==6'b10000) begin PWDATA[31:12] = 32'hff3d2; end else if(select == 6'b100001) begin PWDATA[31:12] = 32'hff311; end else if(select == 6'b100010 | 6'b101011 | 6'b101100 | 6'b101101 |6'b101111 | 6'b110000) begin PWDATA[31:12] = 32'hff351; end else if(select == 6'b100011 | 6'b100111 | 6'b101000 | 6'b101001 | 6'b101010) begin PWDATA[31:12] = 32'hff391; end else if(select == 6'b100100 | 6'b100101 | 6'b100110 ) begin PWDATA[31:12] = 32'hff3d1; end else begin PWDATA[31:12] = 32'hff392; end end else if (PADDR == 16'h34 | PADDR ==16'h48 | PADDR ==16'h5c | PADDR ==16'h70) PWDATA[0] = 1'b1; endfunction
×