recently, i saw there was one written style as the title shown.
this command line was written in a sequence.
i don’t know what p_sequencer here is used for ? is it just because sequence is an object but a component and does not contain get_config_object ? if so, if we use p_sequencer, where could we get the object from ?
There are various techniques we can use to give a sequence access to config (or provide our sequence with access to other parts of our testbench).
Because sequence is a data object, not a component, it does not have a fixed point in the hierarchy to use the config_db in the usual way by specifying an instance path. However, when it is run, it is anchored to a sequencer. We can either use the p_sequencer handle to access the sequencer directly and call an API (that we write ourselves in the sequencer SV code), or use get_full_name() to get the name of the sequencer we are attached to. Then we have a way to access config information.
For highest performance, it is common to have the sequencer get config once, and then store a config object handle for later access by each sequence that runs (this is higher performance than doing a get_config_object() call every sequence execution).
You can read more about configuration techniques for sequences in the Cookbook ConfiguringSequences page