PDA

View Full Version : do_sprint with ovm_sequence



rahulgbe
09-04-2009, 12:00 PM
Hi,

Can the do_sprint be called from an ovm_sequence derived class? The ovm cookbook shows this being called from an ovm_component derived class.
Has anyone done this before?

# ** Error: (vsim-8268) ../src/tb/sequences/file_read_sequence.svh(71): No Default value for formal 'printer' in task/function do_sprint.

The cookbook example in 08_sequences/01_simple/top.sv does not work when the calling task and called function are both in separate ovm sequences.

Thanks,

Rahul.

avidan_e
09-05-2009, 12:49 AM
Hi Rahul,

All the do_* functions are common to all ovm_object derived classes and therefore have the same form in both components and sequences. However,
Normally, you don't call any of the do_* functions yourself. These functions are called automatically when you call sprint(), print(), pack(), unpack() etc. If you're not using the field automation macros, then you have to implement printing yourself by overriding these functions, just like Mark did in his example. If you do use the field automation macros then you get a default implementation which I normally find quite sufficient - it will take every field you declared using the macros and put it, nicely formatted along with its name, in the output string. In any case, the important point is that you should never call these methods directly, only override them with some custom implementation.

Avidan Efody (www.specman-verification.com)
www.specman-verification.com