quirks-uvm-devel Mailing List for Quirks Universal Virtual Machine
Status: Pre-Alpha
Brought to you by:
teodor
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
|
Feb
(1) |
Mar
(9) |
Apr
(23) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: bhavmus m <bh...@ya...> - 2013-02-08 15:34:51
|
http://dj-school.ru/wp-content/themes/skyfall/mypage.php?skszcyh160tocwc Would ye both eat your cake and have your cake? ----------- bhavmus m 2/8/2013 4:34:36 PM etstukjbenagetstukjbenag |
From: Sergei L. <s_l...@ya...> - 2002-08-27 14:42:54
|
Hello! I've made some changes to the existing sources. New specification for core modules will be available soon and than I will start extensive module testing. 1. The schema of error processing is changed. See the file exceptions.h. It emulates exception mechanism like C++ (this idea was gotten from Palm OS SDK). Maxim, could you examine the possibility of such "exceptions" catching available from Ada programs? 2. descr_stack now realized as a two-linked list. It eliminates the limit of stack size. Ada interfaces need to be changed for the create_stack function (it loses the max_size parameter). Now I am working on a test bench. I am trying create random descriptors for stress testing. It demands of solving some mathematic tasks (getting random trees with given features). __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com |
From: Sergei L. <se...@mo...> - 2002-04-21 19:49:27
|
Gentlemen, Now I try define a "basic" set of arithmetic modules (AUs). It will be a "standard" set and it will be the set which Maxim will use in his compiler. Let me present this file: quirks-uvm/aus/base_aus.xml (already under CVS). Now it is not full and contain only modules which operate with bytes (int8). Its format is not complete and may change in details (I mean only format of "<asm>" sections). Till 28 of April I will try fill it with all standard modules I plan use. -- Sergei |
From: <sl...@is...> - 2002-04-19 12:58:14
|
Gentlemen, These are features I plan add to the next release of quirks-uvm (1.1d4). 1. Ada interfaces for backend and data types. 2. Chain mapping. Example: lv is <int32/inout ...>; declare map dy1 is <int32/inout ...>; map is (dy1[0], lv[0]) end map; declare map dx1 is <int32/inout ,,,>; map is (dx1[0], dy1[0]) end map; After this mapping dx1 will point not to lv[0] directly but to its reference in dy1[0]. An arithmetic module can change the pointer in dy1 and after that dx1[0] will be able point to another cell. dx1[0] ---> dy1[0] ----> lv[0] * dx1[0] ---> dy1[0] ----> fp[0] (for example). It will be used, for example, for effective container access realizations. In the example we have only one intermediate reference, but really we will be able have many. 3. Solve 0x7f problem. 4. Solve binary files compatibility. 5. Usage of top level cells (`lv') should be enabled anywhere (with the same rights as lv[0] etc.) -- Sergei |
From: Sergei L. <se...@mo...> - 2002-04-09 19:56:36
|
Hello Bhavani, > The previous problem while creating grammer file > is version diffrence. I used different versions of > bison.simple. Oh, it is my guilt! I've forget put all necessary files in the package. Sorry, because it has taken your time. The best way to avoid problems of such type is installing cygwin: http://sources.redhat.com/cygwin/ (you can choose only necessary package, i.e. bison and flex. They contains all needed files like bison.simple etc). > At this point I came to know that whatever parser file > created in the existing workspace is with bison 1.32. > where as I am using bison 1.34. Well, I use 1.32 because it included in the distribution of Linux I use. I've checked and all worked well under 1.34. But I will try update my bison to 1.34 to avoid unnecessary problems in a future. > I got some problems while creating parser file. so I > am modifying the parser1.ys. Just I would like to > discuss with you about the task that is assigned to > me. > can I change the parser.y file if I get errors. or do > you think I should be in a position to generate > lexer.c and parser.c files without changing any of the > *.l and *.y files? Hm... The tale about our *.y and *.l files is that they are generated and no one should modify they. May be it is ugly, but it is the only method I can found: We have common parts, they lay in lib/uvm. When we create grammar files we glue 3 parts: parser1.ys + parser_cmn.ys + parser2.ys and get parser.y. And the same with lexer.l. Thus, the true way is change *.ys and *.ls and don't change *.y and *.l - they should be assembled in the custom build step you will provide. But I think you already know it. Well, you, of course, can change these files (*.ys, *.ls) if there are problems with build. > > Please let me know. sorry for rising questions too > late. I am trying my best to complete it in time. Really you shown good ability of resolving problems. Don't worry about terms I've picked in a task. We are working with such agreement: Anybody of us can make new task and can change task if I've assigned it. Because our work is voluntary and I don't know about how much free time you will have for working for this project all terms are tentative. But we need to know these terms, so it is your right change terms after I've assigned a task, and I will see when YOU plan finish it. But it is bad practice change it at the end of this time interval, so try plan/change tasks such way that you will be able finish it according to your own plan. You can change tasks when you are logged in on SourceForge through you personal page (you may be know about it). When you will change a task I will get a notification. Also, the good practice is update percent of completion in assigned tasks. I invite you follow these rules. > I did n't get any problems with lexer file. OK. Hope hear you soon. -- Sergei |
From: Sergei L. <sl...@is...> - 2002-04-09 16:38:19
|
The reason why we need to pass a lexical contents (local variables) through fp is a possibility of dynamic structures in our stack. To reach an upper frame in this case we need a pointer becouse offset will not work. But we can solve this problem if we will allocate dynamic structures in a separate stack (it seams to me that it is approach that GNAT use). So, we can disable using lv for dynamic structures and use dn for it. It seems to me that it is a topic for discuss. -- Sergei |
From: Sergei L. <sl...@is...> - 2002-04-09 13:55:10
|
But you are right. Inside one module we use ProcedureId and insert it in all call instructions for internal procedures. But actually it is no problem: we can start renumeration of ProcedureId afer recognize new module header. I.e. `catted' module will consists from several parts, each of it starts with a header. So, I think it is no problem. I think think Quirks module actually can be processed "as a stream" (if I throw out some unimortant stuff from coding format which now prevents it). Sergei Lodyagin wrote: > Max wrote: > >> It depends on library architecture you choise. >> How do you intend to build it? >> For instance I need to call a procedure from other module. >> I need ProcedureId to do this. >> How can I know ProcedureId by Module Name + Procedure Name? >> All procedures from a module are numerated from 1. Right? >> If you merge two modules how can you distinguish first procedure >> from first module and from second module? > > > It seems to me the only approach we should use for linkage - finding > of procedures > by their names (in the given module). In this case we don't need > recompile > programs for use a new version of a library. By the way, most link > program s > perform lookup of procedures by names. > > Thus, I think, loading of Quirks module is a two step process: > > 1. The loading of module itself (at this stage VM assigns > ProcedureId-s to all procedures > in the module. > 2. The linking of the new modules with existing ones. At this stage we > use procedure names > for lookup procedures and make substitution for procedure Id-s in > the call instrunctions. > -- Sergei |
From: Sergei L. <sl...@is...> - 2002-04-09 13:31:11
|
Max wrote: > Sergei Lodyagin wrote: > >> Regarding this, I think about whether to make a binary code cat - >> indifferent. >> For example. You have 2 files: >> >> module1.ru >> module2.ru >> >> Then I can paste together them in one module by `cat': >> >> cat module1.ru module2.ru > module.ru. >> >> >> It is when I found a feature but don't known is it useful or not >> (but actually, the coding of our binary files makes possible such >> procedures). >> >> How do you think, is it useful feature? >> > It depends on library architecture you choise. > How do you intend to build it? > For instance I need to call a procedure from other module. > I need ProcedureId to do this. > How can I know ProcedureId by Module Name + Procedure Name? > All procedures from a module are numerated from 1. Right? > If you merge two modules how can you distinguish first procedure > from first module and from second module? It seems to me the only approach we should use for linkage - finding of procedures by their names (in the given module). In this case we don't need recompile programs for use a new version of a library. By the way, most link program s perform lookup of procedures by names. Thus, I think, loading of Quirks module is a two step process: 1. The loading of module itself (at this stage VM assigns ProcedureId-s to all procedures in the module. 2. The linking of the new modules with existing ones. At this stage we use procedure names for lookup procedures and make substitution for procedure Id-s in the call instrunctions. -- Sergei |
From: Sergei L. <sl...@is...> - 2002-04-09 11:23:44
|
I think the problem with nested fp approach not only in a big number of elements in a cell access "order". Really we can make a cell with unlimited depth. But ... fp[0:1:2:3:4:5:6:7:8:9] The problem is not the order length. The problem is a level of indirections. If the structure we address with such order is wholly placed in a single frame it is OK becouse realy all this access path (0:1:2:3:4:5:6:7:8:9) will be translated in ONE offset. But if each next level will lift us one frame up it will be translated to 10 pointer dereferences for reach the place where the element is stored. It is not a cell restriction topic, it is a performance topic. So, I think "row fp" is better. Each next procedure gets as many fps and lvs as the level of its nesting is. The passing of whole fp (or lv) as a single element don't lead to increasing the number of dereferences and we have only one dereference not regarding how deep we are from the original frame. By the way, do you known what is the model which GNAT uses? About your second question. If you don't need pass parameters to a procedure you can use this form of call instruction: call :proc instead of this: call <reg>, :proc. By the way, there is a form call fp, :proc which you can use. (It is about your 9th weekend question. I've said false, sorry. fp is OK. See quirks-uvm/benchmarks/Bubbles.ua). P.S. Thanks for excelent illustration of your idea. Max wrote: > I need make decission about call convention and passing lexical context. > Can we discuss it? > At a glance there is two aproaches. I called them "nested fp" and "in > row fp". > Can you look at this? > How do you think which is preferable? > Nested fp requires less mapping instructions and deeper structures. > For example to access vaiarble in outermost procedure from subroutine of > fourth nested level you write fp [x:x:x:x]. > Is there restriction on deep of a structure? > I know there is restriction on deep of cell - no more then 4 levels, > right? > Can I map dx, fp[x:x:x:0] and have access to 5-8 levels of structure > through dx? > > "In row method" need more mapping in procedure call, but short cell to > access > variables in parrent functions. > > Second question is if procedure hasn't any parameter shall I pass > "empty no access cell" > in place where usually parameters passed or just skip? > -- Sergei |
From: Max <rez...@us...> - 2002-04-09 08:10:04
|
I need make decission about call convention and passing lexical context. Can we discuss it? At a glance there is two aproaches. I called them "nested fp" and "in row fp". Can you look at this? How do you think which is preferable? Nested fp requires less mapping instructions and deeper structures. For example to access vaiarble in outermost procedure from subroutine of fourth nested level you write fp [x:x:x:x]. Is there restriction on deep of a structure? I know there is restriction on deep of cell - no more then 4 levels, right? Can I map dx, fp[x:x:x:0] and have access to 5-8 levels of structure through dx? "In row method" need more mapping in procedure call, but short cell to access variables in parrent functions. Second question is if procedure hasn't any parameter shall I pass "empty no access cell" in place where usually parameters passed or just skip? Max |
From: Max <rez...@us...> - 2002-04-09 07:37:03
|
Sergei Lodyagin wrote: >> po.code = ftell (out_file); >> --------^^^------- >> >> It seems ftell return -1 for stdin which is unaccepteble for next code. >> > OK. Well. It wasn't a good idea. (I tried perform verification of code > by fixing > a file offset while writing and check it when reading the file. But in > all other cases, > *.ru files are always processed with sequential access). > I think throw out all ftell stuff from the VM code. But before it I > think make a full > specification of binary code module format. It doesn't really need store > positions > (as the ftell make) > Actually I dont insist on stdout writing. I was just surprised. > Regarding this, I think about whether to make a binary code cat - > indifferent. > For example. You have 2 files: > > module1.ru > module2.ru > > Then I can paste together them in one module by `cat': > > cat module1.ru module2.ru > module.ru. > > > It is when I found a feature but don't known is it useful or not > (but actually, the coding of our binary files makes possible such > procedures). > > How do you think, is it useful feature? > It depends on library architecture you choise. How do you intend to build it? For instance I need to call a procedure from other module. I need ProcedureId to do this. How can I know ProcedureId by Module Name + Procedure Name? All procedures from a module are numerated from 1. Right? If you merge two modules how can you distinguish first procedure from first module and from second module? Max |
From: Sergei L. <sl...@is...> - 2002-04-08 12:28:08
|
> void > c_start_procedure (ProcedureId id, > const CellList* cell_list, > UVM* uvm) > { > OrderEl i; > CellListEl* el; > ProcOffs po; > /*har buf[CELL_STR_MAX_LEN+1];*/ > > CHECK_INIT; > po.code = ftell (out_file); > --------^^^------- > > It seems ftell return -1 for stdin which is unaccepteble for next code. > OK. Well. It wasn't a good idea. (I tried perform verification of code by fixing a file offset while writing and check it when reading the file. But in all other cases, *.ru files are always processed with sequential access). I think throw out all ftell stuff from the VM code. But before it I think make a full specification of binary code module format. It doesn't really need store positions (as the ftell make) Regarding this, I think about whether to make a binary code cat - indifferent. For example. You have 2 files: module1.ru module2.ru Then I can paste together them in one module by `cat': cat module1.ru module2.ru > module.ru. It is when I found a feature but don't known is it useful or not (but actually, the coding of our binary files makes possible such procedures). How do you think, is it useful feature? -- Sergei |
From: Max <rez...@us...> - 2002-04-08 12:01:38
|
Thanx for quick answers! Sergei Lodyagin wrote: >> 4) Now my Ada test_uvm works! But only with Asm_Backend. >> a) It does not support stdout as parameter of init_backend, does it? > > > Why not support? : > > ---------------------------------------------------------------- > void > a_init_backend (void* ptr) > { > if (mellow_initialized) fatal_error (FERR_INTERNAL); > out_file = (FILE *) ptr; > <------ /* LOOK HERE. */ > mellow_initialized = 1; > StringDA_init (&proc_names, 10, 20); > StringDA_zero_grow (&proc_names, 1); > indent_level = 0; > } > ------------------------------------------------------------ > What do you mean? > void c_start_procedure (ProcedureId id, const CellList* cell_list, UVM* uvm) { OrderEl i; CellListEl* el; ProcOffs po; /*har buf[CELL_STR_MAX_LEN+1];*/ CHECK_INIT; po.code = ftell (out_file); --------^^^------- It seems ftell return -1 for stdin which is unaccepteble for next code. Max |
From: Sergei L. <sl...@is...> - 2002-04-08 10:26:18
|
Max wrote: > I promised you a lot of questions. Here it is. > > 1) Need more C function! > I prefer in Ada use C entities as atomic time or pointers. > I'm afraid to have not precision binding of complex C structures. > So could you add allocator/initializer/deallocator for > Selector, Cell, Cell_List. (see file my_func.c). OK. I will insert these functions (see my next letter). > > 2) Why dont asm_backend accept Name_Procedure? > It generate P1 instead of name I told. I will try resolve it. > > 3) When does mapping trigger. I thouth there were to situation to trigger > a) at act command > b) at if/loop command with au argument. > But now I see Fibonachi where no action with auSum. Please read this fragment of my answer to Bhavani carefully: ---------------------------------------------------------------------- The second moment is the use of act. I already wrote: >(When you invoke `act' the according map calls all defined AUs from >top to bottom. It is not on principle to which AU from this map you >point with act. Ideally we need only one map and an algorithm for >finding AUs which involved in operation ... > Well, I mean this fragment from your code: > exit @Loop when not lv[0]; > * auMul; > * auSum; > lv[5] <- lv[2]; > We don't need two acts. The *auMul will invoke all AUs declared in the same map to work. They will perform their action according to definition order: > declare map > -- Get access to two registers of >incrementer/decrementer > auInc is <int32/in int32/out stu>; > > -- Three ports of multiplier > auMul is <int32/in int32/in int32/out stu>; > au2Mul is <int32/out int32/in int32/in stu>; > auSum is <int32/in int32/in int32/out >stu>; > > map is > i.e.: auInc, then auMul, then au2Mul, then auSum. In this order each module will perform its action. So, the map is monolithic entity. You can't call separate modules from it. You can refer to all of its modules by pointing any of them, i.e: *auMul; or *auSum; All variants are equal. ---------------------------------------------------------------------------------------------- > > 4) Now my Ada test_uvm works! But only with Asm_Backend. > a) It does not support stdout as parameter of init_backend, does it? Why not support? : ---------------------------------------------------------------- void a_init_backend (void* ptr) { if (mellow_initialized) fatal_error (FERR_INTERNAL); out_file = (FILE *) ptr; <------ /* LOOK HERE. */ mellow_initialized = 1; StringDA_init (&proc_names, 10, 20); StringDA_zero_grow (&proc_names, 1); indent_level = 0; } ------------------------------------------------------------ What do you mean? > > b) When I tried Code Backend it crashed at function > UVM_EXPORT ErrorMark mark_error (void) on line > mark->next_mark = last_error->mark_rec_ptr; > because last_error is NULL. What had I forgot to call? > Ahh! Init_Errors! Ok! It's working now. I can't call init_errors from init_backend becouse one can use more then one backend in one's program. > > 5) Example of lexical context. > I dont see how to use fp for passing lexical context. > Can you help? > > procedure A is > X : Integer; > procedure B is > begin > X := 1; > end B; > begin > B; > end A; declare map dx1 is int32/out; map is (dx1, lv) end map; (but I should fix some errors in the VM to make it works. It will be ready in 1.1.d4). Now works another variant of the same: declare map dx1 is <int32/out stu>; map is (dx1[0], lv[0]) end map; > > > 6) When do you plan next release? The 15th of April is a deadline for 1.1d3 Now I am working on defining a set of problems will be solved in 1.1d4, so I don't know the date of 1.1d4. > > Will you wait for my code generator with current state of compiler? We will release the compiler as a different package. Its release dates can be not the same as for the VM releases. > > > 7) Example of discriminated descriptor usage. Try see on this version of Fibonacci (it really worked on 0.1.1p4 version (before CVS). Sorry, the syntax is archaic ... ----------------------------------------------------------------------------- :Main (fr1[0], fr1[1]) @: ; set <int32 <(int32 int32) int32 arr *1..*2> stu>, fr1 ; sub :Fib ; ret END :Main :Fib (fr1[1:1], fr1[1:2]) ; INPUT ; fr1 = <int32 <(int32 int32) int32 arr *1..*2> stu> ; fr1[0] - the counter; ; fr1[1] - the result vector. set static <(int32 int32) <int32/in arr *1..*2> <int32/in arr *1..*2> <int32/out arr *1..*2> stu>,auSum set static <int32/inout stu>,auDec set static <<(int32 int32) <int32 arr *1..*2> <int32 arr *1..*2> <int32 arr *1..*2> stu> int32 stu>,fr2 map static #1 < auSum[1],fr2[0:1] ; map the discriminants auSum[2],fr2[0:2] auSum[0:1],fr2[0:0:1] ; map the dynamic vectors auSum[0:2],fr2[0:0:2] auSum[0:3],fr2[0:0:3] auDec[0],fr2[1] > map static #2 < auDec[0],fr2[1] > @: mov fr1[0],fr2[1] ; init the counter ; act #2 ; jce @L2 @L1: act #1 jce @L2 mov fr2[0:0:1],fr2[0:0:0] mov fr2[0:0:2],fr2[0:0:1] jmp @L1 @L2: ; mov fr2[0:0:2],fr1[1] ret END :Fib ----------------------------------------------------------------------------- > > > 8) You promise me program for expression translation. > Done! Thanks. > > 9) You map lv, ct, fp to dx before procedure call. What for? > For restrict io mode ? It is for select which variables to pass as well as their io modes. > > Can I write "call :lv, Fact" if I need send all local variables as > procedure parameter? And don't send another parameters? I think it is an uncommon situation to be treated separately. > Can I map au to dx directly or I need an > intermediary local variable ? Mapping of au on dx is an ambiguity. I will not resolve this problem in 1.1d4. So, the answer is "no". > > 10) Dynamic memory (dn) example. How to allocate/deallocate memory. > Why dn is procedure scopped? Full schema is not ready now. I think for full support we need store descriptors of allocated values together with this values. It will be not present in the near future. I can give only this outline: Memory for dn can be allocated/deallocated only when enter/exit block. If you need have some dynamic structure accessible from underlaying procedures you need pass it with fp. We haven't null pointers, so if you would have allocate the memory later (not just after entering the block with this dn) you should use dynamic structure descriptor with variant record of two states: "empty" and the real state ("value"). But the variant record support is not realized now ... (and it will not be included in 1.1d4). dn selector is not for general-purpose dynamic memory. It is for variables which are expensive to store in stack. The general policy is using of container types and not direct using of pointers. But if there is such necessity that can be done very easely ever on a base of present release: - A general pointer is index in the structure <int8 arr *> (and more specific pointers are indexes in more specific structures). - Anybody can write au modules for access to such structure by adding necessary au modules. > > 11) Are there procedures to create environment file (efg)? No. > > 12) How to use mellow backend? Write me sequence of procedure calls. OK. I will work on it. -- Sergei P.S. My next letter will be with the time schedule of problems I promised solved. |
From: Max <rez...@us...> - 2002-04-08 05:18:30
|
I promised you a lot of questions. Here it is. 1) Need more C function! I prefer in Ada use C entities as atomic time or pointers. I'm afraid to have not precision binding of complex C structures. So could you add allocator/initializer/deallocator for Selector, Cell, Cell_List. (see file my_func.c). 2) Why dont asm_backend accept Name_Procedure? It generate P1 instead of name I told. 3) When does mapping trigger. I thouth there were to situation to trigger a) at act command b) at if/loop command with au argument. But now I see Fibonachi where no action with auSum. 4) Now my Ada test_uvm works! But only with Asm_Backend. a) It does not support stdout as parameter of init_backend, does it? b) When I tried Code Backend it crashed at function UVM_EXPORT ErrorMark mark_error (void) on line mark->next_mark = last_error->mark_rec_ptr; because last_error is NULL. What had I forgot to call? Ahh! Init_Errors! Ok! It's working now. 5) Example of lexical context. I dont see how to use fp for passing lexical context. Can you help? procedure A is X : Integer; procedure B is begin X := 1; end B; begin B; end A; 6) When do you plan next release? Will you wait for my code generator with current state of compiler? 7) Example of discriminated descriptor usage. 8) You promise me program for expression translation. Done! Thanks. 9) You map lv, ct, fp to dx before procedure call. What for? For restrict io mode ? Can I write "call :lv, Fact" if I need send all local variables as procedure parameter? Can I map au to dx directly or I need an intermediary local variable ? 10) Dynamic memory (dn) example. How to allocate/deallocate memory. Why dn is procedure scopped? 11) Are there procedures to create environment file (efg)? 12) How to use mellow backend? Write me sequence of procedure calls. Max |
From: Sergei L. <se...@mo...> - 2002-04-07 19:20:44
|
I am glad to introduce new feature in VM. Now we can use debug printing from Quirks programs. New commands are: print "string"; print <cell>; printn "string"; printn <cell>; `printn' is the same as `print' but doesn't feed a line after printing. All printing is performed to standard output. Normally these commands are ignored when an instance for a procedure is created. But if we give "debug" property to instance maker: make instance of :proc (debug) it instantiates all these commands. This property can be added to the property list with others parameters, for example: make instance of :proc (DU, debug) (the order of properties can be arbitrary). Thus, now we can write our "Hello, World!" program :) : procedure :HelloWorld is begin print "Hello, World!"; end :HelloWorld; as well as a counter program: procedure :Counter is lv is <int32/inout int32/inout stu>; declare map auInc is <int32/in int32/out stu>; auCmp is <int32/in int32/in int32/out stu>; map is (auInc[0], lv[0]) (auInc[1], lv[0]) (auCmp[0], lv[0]) (auCmp[1], ct[1]) (auCmp[2], lv[1]) end map; begin printn "Print all numbers from " printn ct[0]; printn " to "; printn ct[1]; print ":"; lv[0] <- ct[0]; loop print lv[0]; until not auCmp[2]; print lv[0]; end :Counter; ========== For Maxim: 2 new backend variables were added: void (*_generate_debug_print_cell) (const Cell* cell, int nl); void (*_generate_debug_print_string) (const char* str, int nl); =========== For Bhavani: You can try add printing to your CtoF program, I'd like you get it successfully executed. I'd like include it as an example of these commands in 1.1d3 release (before the 15 of April). =========== Changes summary: can be browsed in CVS by the description string "TASK 51575". -- Sergei |
From: Sergei L. <se...@mo...> - 2002-04-07 00:09:50
|
It is notification about new feature in VM. Now it is possible to use au selector cells in conditions, for example: while auInc[1] loop ... if auCmp[2] then ... This means that: 1. VM performs implicit ACT command on the selector before branching. 2. Then it gets result from the cell and do branching as usual. Thus, it is more compact variant of the following (let auInc[1] is mapped on lv[0] and auCmp[2] is mapped on lv[1]). loop * auInc; exit when not lv[0]; ... and * auCmp; if lv[1] then ... This new form make loops much more compact and a bit faster. ========= For Maxim: you can now use this new form in a compiler. It is already under CVS. -- Sergei |
From: Bhavani M. <bha...@ya...> - 2002-04-06 20:29:13
|
Hi, I am trying to create parser file from the grammer file using bison. But I get an error saying Dumping stack trace to BISON.EXE.stackdump. stack trace is as below: Stack trace: Frame Function Args 0074C9EC 6105A99E (00000000, 610654CC, 0074C939, 40000112) 0074CA2C 61058105 (000B5347, 00000006, 000004D4, 00000400) 0074CA6C 61058342 (000B5347, 00000006, 0074CACC, 61058789) 0074CA8C 610581CA (00000006, 00000000, 0074CACC, 61058754) 0074CACC 6105879F (0041E81C, 00000000, 0041E81C, 0041E81C) 0074CAEC 61001224 (0040D2E0, 000004D4, 0040E2DD, 0000012E) 0074DB3C 0040EB6C (100210F8, 00000004, 00000000, 000A2273) 0074FB7C 0040EF12 (00000004, 610A0368, 0041B961, 00000001) 0074FB9C 0040913F (00000004, 100210F8, 10020278, 00000000) 0074FD88 61003F42 (00000000, 00000000, 00000000, 00000002) 0074FDB8 61004236 (00409074, 00000000, 818ED144, 00000000) 0074FDD8 61004275 (00000000, 00000000, FFFFFFFF, 00000002) 0074FE08 0041B9E3 (00409074, 0074FC8C, BFFC9490, 0074FF68) 0074FE38 0040103D (00000000, 818BC2F4, 00540000, 6F736942) 0074FF78 BFF8B560 (818ED100, 00000008, 818BC2F4, 00000000) 76993 [sig] BISON 742215 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION Exception: STATUS_ACCESS_VIOLATION at eip=6100D5A3 eax=00000000 ebx=610A5388 ecx=00000001 edx=00750000 esi=0000000F edi=6100D5F8 ebp=00B8FB8C esp=00B8FB88 program=BISON.EXE cs=017F ds=0187 es=0187 fs=7EA7 gs=0000 ss=0187 Stack trace: Frame Function Args 00B8FB8C 6100D5A3 (610A534C, 6100D5F8, 00000000, 61000000) 00B8FBBC 6100D720 (0074C99C, 00000001, 00000001, 00000000) 00B8FEDC 6100F5F1 (00000006, 0000C001, 00000000, FFFFFFFF) 00B8FF3C 6105B869 (00000000, 00000000, 00000000, 00000000) 00B8FF98 61004D49 (610A4600, 818EBA38, 00000008, 818BC2F4) 00B8FFCC BFF88F20 (61004D18, 610A4600, 00000008, 00000000) 107330 [sig] BISON 742215 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION 108022 [sig] BISON 742215 handle_exceptions: Error while dumping state (probably corrupted stack) IS this thing to do with any dll's or problems in grammer file? Thanks bhavani __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ |
From: Sergei L. <se...@mo...> - 2002-04-03 21:54:15
|
> Hi Sergei, > Regarding the flex and bison, I thought I > have to do the following changes. > ADd the *.ls and *.ya files to the project. > Add the options needed in the Project/settings/custom > build. > I am trying to compile the *.ls and *.ys files at this > point. OK. -- Sergei |
From: Sergei L. <se...@mo...> - 2002-04-03 21:48:10
|
> >1. What is auCmp with to channels (in out) ? If it is > >new module you > >enter > >please comment what it does. > > Regarding the above question: > I saw that function in predef_aus.c file. I thought it > does compare two values and store the comparision > value in the output register. > I did it with all guess. I know that this function > definition is kept in > #if 0 > #endif > Oh yes. It is very old schema of comparison. I have trown it out. Usually I use #if 0 and #endif for text which will be deleted. -- Sergei |
From: Bhavani M. <bha...@ya...> - 2002-04-03 16:58:22
|
Hi, I agree with your comments on my modified quirks programs. >1. What is auCmp with to channels (in out) ? If it is >new module you >enter >please comment what it does. Regarding the above question: I saw that function in predef_aus.c file. I thought it does compare two values and store the comparision value in the output register. I did it with all guess. I know that this function definition is kept in #if 0 #endif --- bhavani __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ |
From: Bhavani M. <bha...@ya...> - 2002-04-03 16:06:07
|
Hi Sergei, Regarding the flex and bison, I thought I have to do the following changes. ADd the *.ls and *.ya files to the project. Add the options needed in the Project/settings/custom build. I am trying to compile the *.ls and *.ys files at this point. I have got the command reference book for Pentium.Yet to go through that. -- bhavani __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ |
From: Sergei L. <se...@mo...> - 2002-04-01 21:03:04
|
Hello. > I got the flex, bison and libraries. OK. Let me know if you get any troubles with adding it to the MSVC++ build process. > I am compiling the *.ua with ua.exe. Is this correct? Exactly. `ua' stays for "UVM assembler". The `au' tool is a disassembler. You can view *.ru files with it in the original form. About the first (CtoF) program. It mainly correct. But I haven't catch some error in your previous letter (and you have repeated it). When we define auMul (a b c) it means: c = a * b; And when we define auSum (a b c) it means: c = a + b; When we define auMul (a/out B/in C/in) think like it is equation with unknown a: C = a * B, i.e.: a = C / B. So, the positions of operands in your divisions and subtractions should be changed (We have got 10/(18 * C) instead of 18 * C / 10). In your second example I've found some errors (besides of described above) on topics I haven't good explained yet. Each AU (au module: auSum, auMul) can be (for each procedure) in the single instance. I.e., we can't have two auMul in the same procedure (but auMul, au2Mul, au3Mul). Think about AUs as real electronic devices (procedure scoped). When we say: "map auMul[2] on some register" that means the first multiplier, when we say "map au2Mul[2] on another register" that means the second one. But we cant say "map auMul[2] on the register A and on the register B" (only one real register should be in the mapping relation). Let's I explain the advantage of such approach. Let's see on expression A * B * C. Now we oblige to use intermediate register to store value of A * B i.e.: -- lv[0] = A, lv[1] = B, lv[2] = C, lv[3] = (B * C), fp[0] - the result type ~Mul is <int32/in int32/in int32/out stu>; -- (you can use -- aliases for types). declare map auMul is ~Mul; au2Mul is ~Mul; map is (auMul[0], lv[0]) (auMul[1], lv[1]) (auMul[2], lv[3]) (au2Mul[0], lv[3]) (au2Mul[1], lv[2]) (auMul[2], fp[0]) end map; But it is not our goal. It is temporary stage in movement to more power mapping: declare map auMul is ~Mul; au2Mul is ~Mul; map is (auMul[0], lv[0]) (auMul[1], lv[1]) (auMul[2], au2Mul[0]) -- attach 2 output of auMul to 0 input of au2Mul (au2Mul[1], lv[2]) (auMul[2], fp[0]) end map; We will be able use it if we will accept the principle of AU (Arithmetic Unit) as a device, not AU as a function (or predicate). And with the second variant we get new combined device. I try generate code by patterns which include several devices in such connections. In many cases we can do more accurate register allocation. So, let's think about temporary registers as about temporary solution. The second moment is the use of act. I already wrote: > (When you invoke `act' the according map calls all defined AUs from > top to bottom. It is not on principle to which AU from this map you > point with act. Ideally we need only one map and an algorithm for > finding AUs which involved in operation ... Well, I mean this fragment from your code: > exit @Loop when not lv[0]; > * auMul; > * auSum; > lv[5] <- lv[2]; We don't need two acts. The *auMul will invoke all AUs declared in the same map to work. They will perform their action according to definition order: > declare map > -- Get access to two registers of > incrementer/decrementer > auInc is <int32/in int32/out stu>; > > -- Three ports of multiplier > auMul is <int32/in int32/in int32/out stu>; > au2Mul is <int32/out int32/in int32/in stu>; > auSum is <int32/in int32/in int32/out > stu>; > > map is i.e.: auInc, then auMul, then au2Mul, then auSum. In this order each module will perform its action. So, the map is monolithic entity. You can't call separate modules from it. You can refer to all of its modules by pointing any of them, i.e: *auMul; or *auSum; All variants are equal. OK. Some trifles at the end. 1. What is auCmp with to channels (in out) ? If it is new module you enter please comment what it does. 2. `endif' should be `end if'. 3. Why you doesn't use `else' parts? It is faster. P.S, Now I prepare a general schema of the assembler backend we will implement. I will finish it in a few days. But you could start working in this area (if you wish). The task is: Get a command reference book for any of these processors: Intel 386, 486 or Pentium. Write down all registers besides of those which is used for special operations like protected mode control etc. Try find several groups (they can be intersected). For example: - registers which can be used as any argument in big part of arithmetic operation (general purpose); - accumulator (some operations can work only with it); - registers for counter in rotation operations; ... The main rule is: all register in one groups are fully replaceable in operations. I can use any of these registers in some concrete place. So, this classification should be base on a place where particular set (group) of registers can be use (example of such "place": the first operand of a `mul' operation). Give a simple name (identifier) to each group. We will use such information as a part of description for a target processor. -- Thanks, Sergei |
From: Bhavani M. <bha...@ya...> - 2002-04-01 15:31:48
|
Hi, I got the flex, bison and libraries. And regarding the CtoF program, I agree with your review points. I changed it and now it is compilable. I am compiling the *.ua with ua.exe. Is this correct? Please let me know. The corrected program is below: ------------------------------- --Procedure to convert temperature in Centigrade to Fahrenheit --Temperature in Fahrenheit = 18*C/10 + 32 -- fp[0] = starting C value = 0 -- fp[1] = Max C = 100 -- ct[0] = 18, ct[1] = 10 divide these two values to get 1.8, ct[2] = 32 which is from the formula procedure :CtoF is -- Make four 32 bit local registers. -- Each register is both writeable and readable. lv is <int32/inout int32/inout int32/inout int32/inout stu>; declare map auCmp is <int32/in int32/in int32/out stu>; map is (auCmp[0], lv[1]) (auCmp[1], fp[1]) (auCmp[2], lv[0]) end map; declare map -- Get access to two registers of incrementer/decrementer auInc is <int32/in int32/out stu>; -- Three ports of multiplier auMul is <int32/in int32/in int32/out stu>; au2Mul is <int32/out int32/in int32/in stu>; auSum is <int32/in int32/in int32/out stu>; map is (auInc[0], lv[1]) --Store value of C (auMul[0], ct[0]) (auMul[1], lv[1]) (auMul[2], lv[3]) -- calculate 18 * C (au2Mul[1],lv[3]) (au2Mul[2],ct[1]) (au2Mul[0], lv[2]) -- (18 * C )/10 (auSum[0], lv[2]) (auSum[1], ct[2]) (auSum[2], lv[2]) -- done with conversion of C to F (auInc[1], lv[1]) -- Increment C end map; begin lv[1] <- fp[0]; -- Initial value of C @Loop: loop * auCmp; exit @Loop when not lv[0]; * auSum; end loop; fp[2] <- lv[2]; end :CtoF; I have wriiten One more program for Roots of the equation. The program is below: roots.ua ----------------------------------------------------- --Procedure to calculate the roots of quadratic equation -- Find Descriminant = b*b - 4*a*c -- fp[0] = starting A value = 0 -- fp[1] = Max A = 100, fp[2] is value of Descriminant, output value of fp[3] is 1000 if Roots are Imaginary, fp[3] is 1001 if Roots are real and equal, -- fp[3] is 1002 if Roots are real and unequal. -- ct[0] = 8 value of B , ct[1] = 1 value of C , ct[2] = 4 , ct[3] = 0, ct[4] = 1000, ct[5]=1001, ct[6] = 1002 procedure :roots is -- Make six 32 bit local registers. -- Each register is both writeable and readable. lv is <int32/inout int32/inout int32/inout int32/inout int32/inout int32/inout stu>; declare map auCmp is <int32/in int32/in int32/out stu>; au2Cmp is <int32/in int32/out stu>; map is (auCmp[0], lv[1]) (auCmp[1], fp[1]) (auCmp[2], lv[0]) (auCmp[0], lv[2]) (auCmp[1], ct[3]) (auCmp[2], lv[4]) (au2Cmp[0], lv[5]) (au2Cmp[1], ct[3]) end map; declare map -- Get access to two registers of incrementer/decrementer auInc is <int32/in int32/out stu>; -- Three ports of multiplier auMul is <int32/in int32/in int32/out stu>; -- Three ports of adder auSum is <int32/out int32/in int32/in stu>; map is (auMul[0], ct[0]) (auMul[1], ct[0]) (auMul[2], lv[2]) -- calculate b*b (auMul[0], lv[1]) (auMul[1], ct[1]) (auMul[2], lv[3]) -- calculate a*c (auMul[0], lv[3]) (auMul[1], ct[2]) (auMul[2], lv[3]) -- calculate 4*a*c (auSum[1], lv[2]) (auSum[2], lv[3]) (auSum[0], lv[2]) -- b*b - 4*a*c end map; begin lv[1] <- fp[0]; -- value of A @Loop: loop * auCmp; exit @Loop when not lv[0]; * auMul; * auSum; lv[5] <- lv[2]; * auCmp; if lv[4] then fp[3] <- ct[4]; endif; if not lv[4] then fp[3] <- ct[6]; endif; * au2Cmp; if lv[5] then fp[3] <- ct[5]; endif; end loop; fp[2] <- lv[2]; -- Descriminant end :roots; roots.efg ------------------------------------------------------- ct: <int32/in int32/in int32/in int32/in int32/in int32/in int32/in stu> 8 1 4 0 1000 1001 1002 roots.uvmd ------------------------------------------------------- load "roots.ru" load environment "roots.efg" select module 1 select environment 1 set fp = <int32/inout int32/inout int32/inout int32/inout stu> fp[0] = 0 fp[1] = 100 make instance of :roots ;show #roots run #roots print fp[2] print fp[3] quit --- bhavani __________________________________________________ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/ |
From: Sergei L. <sl...@is...> - 2002-04-01 10:18:50
|
Hello Bhavani, I've put bison.exe and flex.exe as well as needed libraries for use bison/flex from MSVC++ here: http://quirks-uvm.sf.net/win-tools.tgz . That is version of tools which I've tested today with latest sources. Put all directory contents in some directory from your PATH. You could try add custom builds for generating parsers/lexers from *.ls and *.ys files to VC++ build (see corresponding Makefile.am files for reference). P.S. Did you got compilable/runnable files for your CtoF example? -- Sergei. |