这是我第一次使用Specman的Testflow功能。
my_tb_env_testflow.e
:
extend MAIN MAIN_TEST my_tb_env_vseq { // virtual sequence
pre_body() @driver.clock is {
driver.raise_objection(TEST_DONE);
};
body() @driver.clock is first {
// Start issuing transaction only after 500us
wait delay(500 us);
};
post_body() @driver.clock is also {
driver.drop_objection(TEST_DONE);
};
};
// and more lines of code extending the other testflow phases
my_tb_env_seq_lib.e
:
extend MAIN MAIN_TEST my_tb_env_vseq { // virtual seq
!reg_access : vr_ad_sequence;
body() @driver.clock is also {
force '~/tb_top_env/my_signal' = 1;
// some do reg_access vr_ad sequences
};
};
my_test.e
:
extend MAIN MAIN_TEST my_tb_env_vseq { // virtual seq
!my_seq : MY_SEQ vr_enet_seq; // a simple ethernet packet
body() @driver.clock is also {
do my_seq keeping {
.driver == driver.enet_driver;
.packet_kind == ETHERNET_802_3;
};
};
};
每当我将文件MAIN MAIN_TEST
中的body()
is only
my_test.e
扩展为Error: Contradiction at time 500102920000, in a context of the type my_tb_env_vseq:
During the generation in: my_tb_env_vseq-@156
sequence my_tb_env_vseq using testflow = TRUE;
at line 18 in <some_location>/my_tb_env_testflow.e
No set of values exists for:
kind (my_tb_env_vseq_kind, initial range: [MAIN..RANDOM]) that
obey the constraints:keep sequence.kind not in [MAIN..RANDOM] at
line 198 in @tf_util_seq , expanded at line 18 in @my_tb_env_testflow
时,我都能正确看到我的以太网序列。否则,我会看到这个矛盾错误:
my_tb_env_testflow.e
从上面的错误消息中,这是sequence my_tb_env_vseq using testflow = TRUE;
的第18行:
tf_util_seq.e
这是define <testflow_sequence'statement> "sequence <name> using testflow[ ]=[ ](<STATUS>TRUE|FALSE)[[ ],[ ]<any>]" as computed {
result = appendf("sequence %s%s",<name>,(str_empty(<any>)?"":append(" using ",<any>))); // factor out 'testflow' option
if <STATUS> == "FALSE" {
return result;
};
var options: list of string;
if <any> != "" {
options = str_split(<any>, "/ ?, ?/");
};
var created_driver: string = append(<name>, "_driver");
var created_kind: string = append(<name>, "_kind");
var the_item: string;
for each (option) in options do {
compute option !~ "/^(\w+) ?= ?(.*)$/";
if $1 == "item" then {
the_item = $2;
} else if $1 == "created_driver" then {
created_driver = $2;
} else if $1 == "created_kind" then {
created_kind = $2;
};
};
result = appendf("{%s; sequence_testflow %s using created_driver = %s, created_kind = %s;}",result,<name>,created_driver,created_kind);
};
的第198行,这是宏定义的第一行:
my_test.e
但如果我将body()
的{{1}}扩展名更改为is only
,我就不会看到上面的矛盾错误,而且我会在正确驱动my_seq
序列的波形。
有没有办法解决这个问题?