Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


ljepson74 last won the day on December 1 2015

ljepson74 had the most liked content!

About ljepson74

  • Rank
    Junior Member

Profile Information

  • Gender
    Not Telling

Contact Methods

  • Skype

Recent Profile Visitors

1,995 profile views
  1. I nudge this comment to get some more eyes on it, as SystemVerilog folks may now be thinking about the next version of the LRM.
  2. Note/Clarification: With VCS 2019.06 and Riviera Pro 2020.04, the code in the original post works as I expected. cg_fa[0] - Coverage=78.12 % cg_fa[1] - Coverage=1.56 % I try to write code which has "universal" support across "all" simulators. Is the difference across simulators due to ambiguity in the LRM? Is some aspect of my code using a poor style? How can this code be improved for more universal simulator support? (I am trying to avoid publically contrasting simulators, which afaik is verboten.)
  3. Using an array of class objects which have a covergroup in them, I've run into the following problems. I look for a solution which is supported by all/most simulators. This topic array seems to be a common issue, based upon web search results. ERROR TYPE0: Same coverage is recorded for both covergroups, despite option.per_instance=1 being used. # vsim -voptargs=+acc=npr # cg_fa[0] - Coverage=81.25 % # cg_fa[1] - Coverage=81.25 % ERROR TYPE1: Compile error with another simulator cg_fa[0] - Coverage=xmsim: *N,COVNSM: (File: ./testbench.sv, Line: 42):(Time: 0 FS + 0) Sampling of
  4. How can I write the following sequence? If sequence A happens, then sequence A may not happen again until either sequence B or sequence C happens. An example of the sequences might be: sequence seqA; ($rose(A)) ##1 $fell(A); //single cycle A pulse endsequence sequence seqB; B[->1]; //B high for 1 cycle endsequence sequence seqC; (1[*10]); //10 clk cylces endsequence It is important in this question that seqA is a sequence, so that we are not just checking seqA |-> (!A throughout (seqB or seqC)) (For this simple example, afte
  5. Thanks, David. Your response got me reading about the quality of RNGs (which was nice, but not my goal) and your initial example was in C. I was just looking for a way to make a simple system call (from SystemVerilog) to set the seed; to run a handful of times in succession with different seeds. I didn’t read far enough into Doug’s paper**1 to see his example code that you used in your most recent example. % head -4 /dev/urandom | od -N 4 -D -A n | awk '{print $1}' Your second example, www.edaplayground.com/x/Zve, is what I was looking for. Thank you. I use it as you suggeste
  6. basarts, Good point. I had looked into “expr” and some other commands besides date, but should have been looking at exit codes. (I must have been looking at various SV procedures that can be called as either tasks or functions, for too long.) It seems any solution for my original question would require some external, non-SystemVerilog code and a DPI or similar call, which I’ll avoid for my current study purposes on edaplayground. Thanks.
  7. Can a distribution value_range be a list? Or is there way to achieve the same result using "dist"? As shown by non-working example code, I try to do something like this: bit [1:0] twobits; assert(std::randomize(twobits) with {twobits dist {2'b10:=50, inside{2'b00,2'b11,2'b01;}:/50};} ); //INCORRECT assert(std::randomize(twobits) with {twobits dist {2'b10:=50, [2'b00,2'b11,2'b01]:/50};} ); //INCORRECT "18.5.4 Distribution" image snippet from IEEE_Std1800-2017 LRM attached. Is there (isn't there) a way that value_range can be a list of choices, which
  8. Thanks a lot, David. My objective here is simply to be able to push "Run" on edaplayground a few times (usually <5), and to see different results. On Questa, I can use "-svseed=random". I don't know the settings for all of the simulators, so tried an experiment to generate random seeds 100% from within SystemVerilog, as I wrote above (rather than using compiler/simulator switches). For my purposes, if the randomess is not very good ... I don't care. The quality of the randomness is not my objective here. Thanks for that detailed reply, however. You and Doug are great teachers. I'
  9. Does $system() really return an int when called as a function? (Perhaps no one has implemented this part of the LRM?) int myseed; myseed = $system("date"); //should output "return value of the call to system() with data type int" quote source: IEEE_Std1800-2017 Section 20.18.1 $system I have not been able to get a non-0 return value, as far as I can tell. Am I doing something incorretly or is this not implemented? What if $system("date") is called? I suppose the "date" system output is longer than 32b, so perhaps the lowest bits are all 0s and the upper ones that c
  10. @kurtlin , do you know this by chance? I am looking for each VCS simulation 'run' to use a different seed. (I'm using EDAPlayground, so don't have access to a set of user guides.) On a related note to compile switches, besides replacing -sverilog with -sv=2009, as you showed in another thread **1, I found this below. (I suspect that -sv=2009 is a superset of "-assert svaext". So, I'll probably stick with that. Thanks again.) Perhaps I might set the seed from within the code, performing a string operation on the output of $system("date") **1:
  11. Yes, thanks Dave. (I saw that. I was trying not to make comparisons between them, lest I violate some benchmarking rule or such.) (I'll move on to another topic now, as I work to get the rust off of my SystemVerilog skills.)
  12. Thank you. I could not (easily, so I gave up) find information about the compiler switches online. a) -sv=2009 works and the compiler error disappears b) The assertion AS_TRUE5_STRONG does not fail, as expected, based on the LRM description of "strong". IEEE_Std1800-2017 : 16.12.2 Sequence property Aren't the clock cycles of the sequence which do not complete (because the simulation ends) empty matches?
  13. The below assertions check that gnt is not high for consecutive clk cycles. Q1: v1 vs. v2: Are there benefits or relevant differences between these styles. Q2: v2 vs. v3: Does the placement of delay matter? Besides for end of simulation termination. The questions are mainly about whether some style is better for the simulator, or there is some non-obvious situation I should consider. module top; bit clk, gnt; bit [19:0] gnt_a; initial begin gnt_a = 20'b0011001010_0000001101; #200 $finish; end assign gnt = gnt_a[19]; always clk = #5 ~clk; always
  14. Does VCS 2019.06 support strong and weak? (Or is there a VCS switch needed to use LRM 2009+?) I get the following error with the code below. Error-[IND] Identifier not declared testbench.sv, 15 Identifier 'weak' has not been declared yet. If this error is not expected, please check if you have set `default_nettype to none. Error-[IND] Identifier not declared testbench.sv, 16 Identifier 'strong' has not been declared yet. If this error is not expected, please check if you have set `default_nettype to none. Code: //Weak & Strong seem to not work in VCS 20
  15. Synopsys VCS: What is the run option to use a random seed?
  • Create New...