e

How do I declare a list of fixed length in specman?

In E (specman) I want to declare variables that are lists, and I want to fix their lengths. It's easy to do for a member of a struct: thread[2] : list of thread_t; while for a "regular" variable in a function the above doesn't work, and I have to do something like: var warned : list of bool; gen warned keeping { it.size() == 5; ...

Best Editor or IDE for Ruby?

I've heard so much about Textmate - The Missing Editor for Mac and that it is the best one for Ruby. What is your choice? And what is the best Ruby editor on Windows? E? ...

Specman macro to do set subtraction with int_range_list objects

I work with a bunch of sets in order to generate constrained random traffic, but I want to be able to call a Specman macro that computes the complement of a set with syntax like: COMPLEMENT begin domain=[0..10,24..30], complmenting_set=[2..3,27..30] end and have it generate: [0..1,4..10,24..26] Every time I need the complemen...

How do I change the default *.elog log file name for an interpreted Specman session?

I want to be able to specify the file name stem for the log file in a Specman test. I need to hard-code the main *.elog filename so that I don't get variance between tests and confuse the post-processing scripts. Is there a constraint or command line I can pass into Specman? ...

can I set the constraints for a variable once and generate a few times in specman?

I have a variable that I want to generate a few times in the same function, each time with the same set of constraints. Can I set the constraints once and the just gen it many times? That is, instead of this: var a:uint; gen a keeping {it in [100..120];}; // some code that uses a . . . gen a keeping {it in [100..120];}; // some code t...

In Specman, how can I tell if a reference to a unit has the do-not-generate modifier in front of it?

In Specman, how can I tell if a reference to a unit has the do-not-generate modifier, '!', at the reference's definition? e.g. unit foo_u { }; extend sys { foo : foo_u is instance; foo_ptr_generated : foo_u; keep foo_ptr_generated == foo; !foo_ptr_notgenerated : foo_u; connect_pointers() is also { foo_ptr_notgene...

how can I count the number of set bits in a uint in specman?

I want to count the number of set bits in a uint in Specman: var x: uint; gen x; var x_set_bits: uint; x_set_bits = ?; What's the best way to do this? ...

VIM syntax file for specman

Where can I find an updated syntax file for specman? There are a number of these on the web, but I want one with recommendations. ...

Calculating e^x without using any functions

We are supposed to calculate e^x using this kind of formula: e^x = 1 + (x ^ 1 / 1!) + (x ^ 2 / 2!) ...... I have this code so far: while (result >= 1.0E-20 ) { power = power * input; factorial = factorial * counter; result = power / factorial; eValue += result; counter++; iterations++; } My problem now is tha...

Returning an array in Specman

How do I return an array from a method call in Specman? E.g. method a : list of uint is { var data: list of uint; ..... result = data; }; extend sys { var data_sys: list of uint; run() is also { data_sys = a(); }; }; My print out shows some elements are different from array data and data_sys. Can you tell me what I mi...

splitting a string into a list in specman

Supposing I have a string: str = “ab,cd,ef” and I want to split it into a list lst = [“ab”,”cd”,ef”] How can I do it best, assuming that I don’t know ahead of time how many items are in the string? Basically I'm looking for a specman equivalent to Perl's: $str = "ab,cd,ef"; @lst = split /,/, $str; ...

how can I create a reference to a variable in specman?

I have the following code in specman: var x := some.very.long.path.to.a.variable.in.another.struct; while (x == some_value) { //do something that uses x; //wait for something //get a new value for x x = some.very.long.path.to.a.variable.in.another.struct; }; Now, it seems wasteful to write the assignment to x twice; ...

using "apply()" with methods that return void in specman

Specman has the apply() method to perform the same action on all elements of a list: var a: list of int; a = somefunction.that.returns.list.of.int(); var b:= a.apply(it * 2); Where apply() does the same as: for each in a { b.add(it.*2); }; Now, if I want to call a method on the elements of a, I can use apply() so long as the me...

How to get E Text Editor to upload local copy of project files to server?

Hi, I'm new to E Text Editor. I have a project saved locally on my computer, that replicates a folder saved on my server. When I use my php IDE (PhpEd) and save a change to the locally saved file, it automatically updates the respective file on my server. Can I customize E Text Editor to do this also? It would save lots of time! Than...

reduce list in Specman like in Python

Is there a reduce() list method in Specman that I can use for general reduction functions? I'm thinking of something like: var x: list of bit = some_function_that_returns_list_of_bit; var bitmap: uint = x.reduce(foo()); where reduce() works like in Python: foo(last: uint, val: bit) is: uint { return (last << 1 ) | bit; }; ...

What's the difference between to_string() and as_a(string) in specman?

In Specman I can convert a variable to a string using either: x.to_string(); or x.as_a(string); Is there any difference between the two? If not, why does Specman provide both? ...

How can I wait for one event out of a list of events in specman?

I have a struct in specman: struct foo_s { event foo_ev; // some code that will emit foo_ev sometimes }; And a list: var foo_l: list of foo_s; // later code will manage the list And now I want to sync on any of the foo_ev events in the list: first of { sync @foo_l[0].foo_ev; sync @foo_l[1].foo_ev; sync @foo_l...

regular expression problem

Hi, The regular expression ^(((\d{3}) ?)|(\d{3}-))?\d{3}-\d{4}$ matches strings of the form XXX-XXX-XXXX and XXX-XXXX (am I missing out something?) It doesn't, however, match (XXX) XXX-XXXX and (XXX) XXX-XXX-XXXX as well (which I need it to match). Can you help me fix it so that it matches the formats XXX-XXX-XXXX, XXX-XXXX, (XXX) ...

E Learning Platform

Hi guys am in need of creating e learning environment project using flex and java could sombudy help me ? Thanks Give ur ideas it wud sure help me out ...

e store, processing credit cards and paypal

Hi there, I am building an e store and concerned about security of transactions. Does any body know a good reference for best practices? I also am wondering if it is a good idea to store credit card info in the Database for the sake of reuse by customers. to be honest I am a bit scared by the idea. any suggestions? thank you ...