specman

TE to check two events coinciding or delayed

笑着哭i 提交于 2020-01-17 04:51:26
问题 I have two events @A and @B. I want to check that at occurrence of @A, @B is either emitted at the same time or some cycles later. expect my_check is ((@A and @B) or (@A => {[0..N]; @B}))@clk exec { message(NONE, "my_check"); }; However, I can see (from the message) that the TE succeeds every clock cycle from the start of the simulation. This is puzzling, as neither A nor B occur in that timeframe. Any ideas what's wrong? Is it forbidden to mix boolean and temporal yield operator? 回答1: What

Difference between “new” and “gen”

房东的猫 提交于 2019-12-24 15:42:33
问题 I've done a little playing around in the console and debugger, but I've still got some questions about how new and gen work differently from each other. What is the difference between using new to generate a struct verse using gen to generate a struct? Does "gen" use existing allocated memory and "new" allocate new memory? or both allocate memory? Does "new" generate everything like a "gen" statement? In cdnshelp it says "new" is a shallow struct, meaning struct fields are not allocated. Is

Specman: how to retrieve values of var which is stored in another var

浪尽此生 提交于 2019-12-23 18:00:23
问题 I have stored var name in another var and I want to retrieve values from original var. for ex: var var_A: list of uint = {1,3,2}; var var_A_str:string = "var_A"; //Now i want to print var_A list of values using var_A_str. How can i do that? print $var_A_str; 回答1: This is called introspection or reflection. You have to use Specman's rf_manager . Search for it in the docs. However, the docs don't show you all the methods that this unit has. If you really want to see all the methods, run this

Specman: Error in on-the-fly generating of list of lists with all different values

╄→尐↘猪︶ㄣ 提交于 2019-12-11 13:46:55
问题 I try to generate on-the-fly list of list of uint ( my_list_of_list ) with all different values (I have a variable num_of_ms_in_each_g : list of uint , that keeps lengths of every list inside my_list_of_list ): var my_list_of_list : list of list of uint; gen my_list_of_list keeping { for each (g) using index (g_idx) in it { g.size() == num_of_ms_in_each_g[g_idx]; for each (m) using index (m_idx) in g { // Error in the next line: m not in it[0..g_idx-1][0..num_of_ms_in_each_g[g_idx]-1]; m not

In specman how to test for the existence of a variable or struct field?

穿精又带淫゛_ 提交于 2019-12-11 07:27:22
问题 Little in the specman manual would indicate that one can determine on the fly whether a specific variable has been created. (not asking about testing for array index or hash members, which can be done via exists() ) I only noticed that discussion of struct name/path resolution does say that attempting a 'keep' on a struct field that does not exist within the path resolved will result in an error and _must_be_ commented out... My work involves simulating a model constantly updated by multiple