Spinroot

A forum for Spin users

You are not logged in.

#1 2012-05-22 15:44:02

MuhammadIsmail
Member
From: Pakistan
Registered: 2012-05-22
Posts: 23

How to declare a two D array of 12 bits location each

I need to declare 2D arrays but using "short datatype" the verification is not proceeding and on run following is displayed

State-vector 1028 byte, depth reached 27, errors: 1
        1 states, stored
        0 states, matched
        1 transitions (= stored+matched)
       27 atomic steps
hash conflicts:         0 (resolved)

    2.539	memory usage (Mbyte) 

I can't able to understand this

I am making 2D array as follows

typedef VECTOR1{
		short vector1[c];
		}
	VECTOR free[r];             			
	VECTOR used[r];   

   
  Please have a look at code and propose some solution

Offline

#2 2012-05-22 16:53:55

spinroot
forum
Registered: 2010-11-18
Posts: 695
Website

Re: How to declare a two D array of 12 bits location each

the code looks okay -- but there must be something else wrong in your model
that prevents any state change from taking place

Offline

#3 2012-05-24 06:49:29

MuhammadIsmail
Member
From: Pakistan
Registered: 2012-05-22
Posts: 23

Re: How to declare a two D array of 12 bits location each

When I use byte the complete model is working ok. but when I change it to short it gives the result as mentioned. I need actually 12 bits. I think 12 bits will work in my model.
By 16 bits(short) even the execution cannot proceed from the start.
By 8 bits(byte) everything is ok but there is truncation when I use simulation/run.

Please give me some reason for this. I think it is state explosion. I do not know whether I am right or wrong.
I need a solution for how to make a 12 bit 2-D array to avoid this problem.

Offline

#4 2012-05-24 06:53:17

spinroot
forum
Registered: 2010-11-18
Posts: 695
Website

Re: How to declare a two D array of 12 bits location each

Can you show the rest of the model?
It is not possible to diagnose the problem without seeing the context...

Offline

#5 2012-05-24 07:22:10

MuhammadIsmail
Member
From: Pakistan
Registered: 2012-05-22
Posts: 23

Re: How to declare a two D array of 12 bits location each

Is there any way to declare 12 bit array or not.
Is this a problem of state explosion.

Offline

#6 2012-05-24 14:26:05

spinroot
forum
Registered: 2010-11-18
Posts: 695
Website

Re: How to declare a two D array of 12 bits location each

Q1: yes
Q2: no

Offline

#7 2012-05-25 06:49:24

MuhammadIsmail
Member
From: Pakistan
Registered: 2012-05-22
Posts: 23

Re: How to declare a two D array of 12 bits location each

[u]Here when I am sending the complete model. It gives me the following errer.[/u]

406 not acceptable
An appropriate representation of the requested resource /fluxbb/post.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Offline

#8 2012-05-25 07:02:14

MuhammadIsmail
Member
From: Pakistan
Registered: 2012-05-22
Posts: 23

Re: How to declare a two D array of 12 bits location each

Can u plz tell me how to declare a 12 bit 2 d array

Offline

#9 2012-05-25 16:53:00

spinroot
forum
Registered: 2010-11-18
Posts: 695
Website

Re: How to declare a two D array of 12 bits location each

typedef U {
    unsigned v : 12;
};

typedef Vector {
    U w[5];
};

Vector f[2];

init {
    f[1].w[2].v = 3
}

this is one way to define it. note though that how the compiler will represent
these data structures during verification is not defined: so if you want to use
the 12-bit quantity in an effort to reduce memory use, this may not have the
desired effect. (the compiler will likely pad the 12-bit structure to 16 or 32 bits
to achieve proper word alignment -- but all that would be beyond the control
of spin and the model)

Offline

Board footer

Powered by FluxBB