i did so but this error was the result:
Error on line 7 ) : near "=": syntax error, unexpected '=', expecting IDENTIFIER or TYPE_IDENTIFIER
what is this?
i did something like this another time on another project , and there was an error "Undersolved reference to 'glb_var_mod"
and what is this?!
Hi
Maybe you got this error because you didn't use 'always' or 'initial' blocks. Assigning values to reg must be in one of these blocks depending on situation.
For example:
module glb_var_mod; // define all global vars in this module
initial
reg glb_x = 1'b1;
endmodule
Just a note that global variables are not synthesizable, and in general, not a good programming practice in any language.
If instead you really need a global value, use a `define in Verilog or a parameter declared in a package in SystemVerilog.