system verilog - copy an object to a handle in systemverilog -


i have 1 module, mod1, includes 1 class, my_test. inside mod1 there instance of module mod2 , mod2 includes class, my_config. "my_test" class includes my_config class. want copy object of my_config class handle of class instantiated inside mod2 module. below code snippets, can follow. my_test, my_config, mod1, mod2 in different files.

class my_test;   my_config cfg_2;     // instance of my_config class   // here object created   // here have assigned values properties of my_config class   ... endclass : my_test  module mod2;   my_config cfg_1;     // instance of my_config class   // mod2 file includes my_config class   ... endmodule : mod2  `include "my_test.sv" // included inside file "mod1"   module mod1;   mod2 m2(..);         // module instance of module mod2   // mod1 file includes my_test class   m2.cfg_1 = cfg_2;    // cfg_1 instance of my_config, inside mod2   // in above line trying copy object cfg_2 handle cfg_1   // getting error in above line.   ... endmodule : mod1 

can please me out. thanks

you don't show instance of my_test here, assuming create under name my_test_inst, following:

module mod1();   //...    // can add procedural code in initial blocks   initial     m2.cfg_1 = my_test_inst.cfg_2  endmodule 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -