kaggala Posted September 22, 2015 Report Share Posted September 22, 2015 Hi All, I am seeing following error when I try to assign array values using inline constraints Array size's and dimensions are same and array slicing is not there ,but still I see below error. Can somebody please through light on this error? Also suggest best practices class A_seq extends uvm_sequence #(id_nfc_tx_transfer); `uvm_object_utils(A_seq) `uvm_declare_p_sequencer(tx_sequencer) bit [7:0] data_byte[`MAX_DATA:0] ; function new(string name="A_seq"); super.new(name); endfunction virtual task body(); ///Array Initialization for (int i=0;i<=5;i++) data_byte= 'hAB; `uvm_do_with(req,{ tx_bit_rate_sel ==212; tx_num_of_bytes == 5; tx_data_byte == data_byte; }) endtask endclass Error :Randomization constraint has this error, which will cause the randomize function to return 0 and no new rand values will be set: Slices of unpacked arrays are not currently supported in this context Quote Link to comment Share on other sites More sharing options...
kirloy369 Posted September 28, 2015 Report Share Posted September 28, 2015 Try to use: foreach(tx_data_byte) tx_data_byte == data_byte; instead : tx_data_byte == data_byte; I think that operation on whole arrays in constraints is illegal at least when we strictly stick to SV LRM text Quote Link to comment Share on other sites More sharing options...
c4brian Posted October 23, 2015 Report Share Posted October 23, 2015 Is tx_data_byte a fixed-size array? If you are just trying to randomize the elements, just declare it as rand in the transaction, and remove data_byte, and the constraints, etc. If its a dynamic array, then use tx_data_byte.size()==tx_num_of_bytes (inside of the transaction class), then you don't have even add it in everytime you randomize the transaction. Did that make sense? 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.