quirks-uvm-devel Mailing List for Quirks Universal Virtual Machine (Page 2)
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: Sergei L. <se...@mo...> - 2002-03-30 18:38:03
|
Hello Bhavani. Sorry for delay. Thanks for this good example. I found 8 errors (it is normal because it is impossible guess all I think). Correct me if I don't catch something. Let's start. 1. You make iteration from fp[0] to fp[2] and use lv[4] as a variable (counter) of this loop. But you should initialize it: lv[4] <- fp[0] before the loop. (Declarative part before `begin' (I mean maps) do nothing with anything). 2. If you would like to know what is auCmp look at the quirks-uvm/uvm/src/lib/cart/predef_aus.c file. This file defines all arithmetic modules I used. There is a function cmpInt32_iio for the module auCmp <in in out> in this file. It perform such operation: auCmp[2] = auCmp[0] < auCmp[1] But your order of argument is not right. I think you mean: lv[0] = lv[4] < fp[1] but you get: lv[0] = fp[1] < lv[4] The question is `what auCmp means'. In the current cartridge it means "<". I agree, auCmp is not a good name for "<". It seems to me that the exit condition should be `not lv[0]'. 3. The order of selector declaration in a map definition defines the order of actions: auInc auMul au2Mul it is inc, then mul mul. I think mul mul then inc will be better in the context of your loop (or use 2 maps and 2 act commands, but one map runs faster on our interpreter). (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, but now we use less intellectual scheme). 4. You use lv[1], lv[2] and lv[6] to store constants. You can drop this variables and use ct[0], ct[1] and ct[2] directly (they are "memorized" entities). 5. You can't store 1.8 in lv[3]. It is for integers. I sought you can realize the following approach: 18 * C / 10 + 32. It is better method before that time when we will include floating point types (but really it is very simple task, I mean floating point addition). 6. We can't have more than one register attached to a channel (see the case with auInc[0] in your program). See error 1. 7. We can't write to a registers with `in' mode (you use several in the `lv' selector. It is impossible to map `out' from AU on `in' register). 8. You miss ';' in many places. The good side is that if we try start your program we find a places with bad error reporting. Now it is really weak side - in many cases uvm do "fatal error" without explanation. So, I put one more test template in my money-box :) So, I wait for corrected version. P.S. The list is OK and I hear you. Don't worry about it. > Hi, > Thanks for the answers. Now I am able to write > some thing. Here is my first program which does > Conversion of temperature. please let me know your > comments. > > below is CtoF.ua file. > ------------------------------------------------------- > --Procedure to convert temperature in Centigrade to > Fahrenheit and Vice Versa > --Temperature in Fahrenheit = 1.8*C + 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 two 32 bit local registers. > -- Each register is both writeable and readable. > lv is <int32/inout int32/in int32/in int32/inout > int32/inout int32/inout int32/in stu>; > > declare map > auCmp is <int32/in int32/in int32/out stu>; > map is > (auCmp[1], lv[4]) > (auCmp[0], 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/out int32/in int32/in stu>; > au2Mul is <int32/in int32/in int32/out stu>; > auSum is <int32/in int32/in int32/out > stu>; > > map is > > (auInc[0], fp[0]) --Starting value of C > (auMul[1], lv[1]) (auMul[2], lv[2]) (auMul[0], > lv[3]) -- calculate 18/10 = 1.8 > (auInc[0], lv[4]) -- C > (au2Mul[0],lv[4]) > (au2Mul[1],lv[3]) > (au2Mul[2}, lv[5]) > (auSum[0], lv[5]) > (auSum[1], lv[6]) > (auSum[2], lv[5]) -- done with conversion > of C to F > (auInc[1], lv[4]) -- Increment C > end map; begin > lv[1] <- ct[0] -- value 18 > lv[2] <- ct[1] -- value 10 > lv[6] <- ct[2] -- value 32 > @Loop: loop > * auCmp; > exit @Loop when lv[0]; > * auSum; > end loop; > fp[2] <- lv[5]; > end :CtoF > > > > below is CtoF.efg file. > ------------------------------------------------------- > ct: > <int32/in int32/in int32/in stu> > 18 > 10 > 32 > -------------- > > > below is CtoF.uvmd file. > ------------------------------------------------------- > load "CtoFconversion.ru" > load environment "CtoFconversion.efg" > select module 1 > select environment 1 > set fp = <int32/inout int32/inout int32/inout stu> > fp[0] = 0 > fp[1] = 100 > make instance of :CtoF > ;show #CtoF > run #CtoF > print fp[2] > quit > -- Sergei. |
From: Bhavani M. <bha...@ya...> - 2002-03-30 17:12:44
|
Hi, Thanks for the answers. Now I am able to write some thing. Here is my first program which does Conversion of temperature. please let me know your comments. below is CtoF.ua file. ------------------------------------------------------ --Procedure to convert temperature in Centigrade to Fahrenheit and Vice Versa --Temperature in Fahrenheit = 1.8*C + 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 two 32 bit local registers. -- Each register is both writeable and readable. lv is <int32/inout int32/in int32/in int32/inout int32/inout int32/inout int32/in stu>; declare map auCmp is <int32/in int32/in int32/out stu>; map is (auCmp[1], lv[4]) (auCmp[0], 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/out int32/in int32/in stu>; au2Mul is <int32/in int32/in int32/out stu>; auSum is <int32/in int32/in int32/out stu>; map is (auInc[0], fp[0]) --Starting value of C (auMul[1], lv[1]) (auMul[2], lv[2]) (auMul[0], lv[3]) -- calculate 18/10 = 1.8 (auInc[0], lv[4]) -- C (au2Mul[0],lv[4]) (au2Mul[1],lv[3]) (au2Mul[2}, lv[5]) (auSum[0], lv[5]) (auSum[1], lv[6]) (auSum[2], lv[5]) -- done with conversion of C to F (auInc[1], lv[4]) -- Increment C end map; begin lv[1] <- ct[0] -- value 18 lv[2] <- ct[1] -- value 10 lv[6] <- ct[2] -- value 32 @Loop: loop * auCmp; exit @Loop when lv[0]; * auSum; end loop; fp[2] <- lv[5]; end :CtoF below is CtoF.efg file. ------------------------------------------------------ ct: <int32/in int32/in int32/in stu> 18 10 32 -------------- below is CtoF.uvmd file. ------------------------------------------------------ load "CtoFconversion.ru" load environment "CtoFconversion.efg" select module 1 select environment 1 set fp = <int32/inout int32/inout int32/inout stu> fp[0] = 0 fp[1] = 100 make instance of :CtoF ;show #CtoF run #CtoF print fp[2] quit __________________________________________________ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/ |
From: Bhavani M. <bha...@ya...> - 2002-03-29 21:15:39
|
Hi, Thanks for the answers. Now I am able to write some thing. Here is my first program which does Conversion of temperature. please let me know your comments. below is CtoF.ua file. ------------------------------------------------------- --Procedure to convert temperature in Centigrade to Fahrenheit and Vice Versa --Temperature in Fahrenheit = 1.8*C + 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 two 32 bit local registers. -- Each register is both writeable and readable. lv is <int32/inout int32/in int32/in int32/inout int32/inout int32/inout int32/in stu>; declare map auCmp is <int32/in int32/in int32/out stu>; map is (auCmp[1], lv[4]) (auCmp[0], 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/out int32/in int32/in stu>; au2Mul is <int32/in int32/in int32/out stu>; auSum is <int32/in int32/in int32/out stu>; map is (auInc[0], fp[0]) --Starting value of C (auMul[1], lv[1]) (auMul[2], lv[2]) (auMul[0], lv[3]) -- calculate 18/10 = 1.8 (auInc[0], lv[4]) -- C (au2Mul[0],lv[4]) (au2Mul[1],lv[3]) (au2Mul[2}, lv[5]) (auSum[0], lv[5]) (auSum[1], lv[6]) (auSum[2], lv[5]) -- done with conversion of C to F (auInc[1], lv[4]) -- Increment C end map; begin lv[1] <- ct[0] -- value 18 lv[2] <- ct[1] -- value 10 lv[6] <- ct[2] -- value 32 @Loop: loop * auCmp; exit @Loop when lv[0]; * auSum; end loop; fp[2] <- lv[5]; end :CtoF below is CtoF.efg file. ------------------------------------------------------- ct: <int32/in int32/in int32/in stu> 18 10 32 -------------- below is CtoF.uvmd file. ------------------------------------------------------- load "CtoFconversion.ru" load environment "CtoFconversion.efg" select module 1 select environment 1 set fp = <int32/inout int32/inout int32/inout stu> fp[0] = 0 fp[1] = 100 make instance of :CtoF ;show #CtoF run #CtoF print fp[2] quit __________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ |
From: Sergei L. <sl...@is...> - 2002-03-29 15:02:43
|
Hi. Bhavani Malladi wrote: >>Date: Thu, 28 Mar 2002 14:00:09 -0800 (PST) >>From: bhavmus m <bh...@ya...> >>Subject: query on quirks examples >>To: qui...@li... >> >> >>Hi, >> >> I have got the following questions after going >>through the simple example. >> >> >>1. usage of fp[0], fp[1] is little bit confusing. I >>am thinking these are the procedure parameters and >>can be used for procedure INPUT or OUTPUT >> Yes. All input/output of procedure or function can be done through `fp' selector. But you can see that this selector is not defined inside this procedure. The reason is that every procedure is generic and got real fp descriptor before making instantion. >> >>2. why can not we declare the ct value in the >>fact.ua file? >> Becouse a procedure is a generic entity. Now in this procedure static int32 type is used for all registers. lv is <int32 int32 stu> In future will be possible write something like this: lv is <fp[0] fp[1] stu> (or lv is fp descriptor) in this case we will not have any predefined type in the procedure and use types of passed values. We can switch from int32 type for int64 type or ever multiply precision type without changing the code. But in this case we cann't define any constants inside the function. I agree , for some cases we can implement simpler model. It is needed think about it. Have you any ideas? >> >>3. I am able to understand the declaration of >>registers, but not the actual mapping done below. >> map is >> (auMul[1], lv[1]) (auMul[0], fp[0]) (auMul[2], >>fp[1]) >> end map; >> The mapping syntax at present stage is very ugly. We need improve it. For example: auMul (fp[0], lv[1], fp[1]) Let's unroll it as: fp1 = fp[0] * lv[1] (according to the input/output modes of auMul declaration - [in in out]) In the case of [out in in] it will be: fp[0] = fp[1] / lv[1] It is that we have in Prolog or Mercury. Such definition besides of all gives a hint for code generator. >> >>4. I want to have some more explanation for *act >>command. >> The answer is in "Quirks UVM architecture overview". I will be very appreciate if you help me make it more readable and understandable :) Find the section about mapping and act command and let's talk about unclear places in it. By the way, the example I send to you contain only one map. This example in benchmarks is more accurate (with two maps). >> >>5. I have gone through the fibonacci example too. it >>is easy compared to factorial. In this example also >>I did n't get the >>purpose of mapping lv[3] twice. >> auInc is <int32/out int32/in> it is reverseable form, thus we can restore original value if we make the same but in reverse: auInc is <int32/in int32/out> There are some cases when it is useful (for example compare dec ax call foo inc ax ... and mov bx, ax dec ax call foo mov ax,bx (i.e. , we can undo this instruction) But you can define auInc is int32/inout; and use this form with only one channel. >> Why do we need auSum >>register, even though we have the actual result in >>lv[2]? >> auSum it is not register becouse it is entity without memory. Try use simple rule: in any mapping relation can be only one real register, i.e. an entity which store values. auSum[2] is only adder output. We can have a lot of input/outputs attached to one memory register (but no many registers attached to one channel). >> >>procedure :Fibonacci is >> lv is <int32/inout int32/inout int32/inout >>int32/inout stu>; >> >> declare map >> auInc is <int32/out int32/in stu>; >> auSum is <int32/in int32/in int32/out stu>; >> map is >> (lv[3],auInc[0]) >> (lv[3],auInc[1]) >> (lv[0],auSum[0]) >> (lv[1],auSum[1]) >> (lv[2],auSum[2]) >> end map; >>begin >> lv[3] <- fp[0]; >> lv[0] <- ct[0]; >> lv[1] <- ct[1]; >> >> loop >> * auInc; >> lv[0] <- lv[1]; >> lv[1] <- lv[2]; >> until not lv[3]; >> >> fp[1] <- lv[2]; >> >>end :Fibonacci; >> >> >> >> >> >> >>procedure :fact is >> -- Make two 32 bit local registers. >> -- Each register is both writeable and readable. >> lv is <int32/inout int32/inout stu>; >> >> declare map >> -- Get access to two registers of >>incrementer/decrementer >> auInc is <int32/out int32/in stu>; >> >> -- Make two virtual registers (they are simple >>"ports" >> -- and now they are attached to nothing). >> dx1 is <int32/in int32/out stu>; >> >> -- Three ports of multiplier >> auMul is <int32/in int32/in int32/out stu>; >> map is >> -- Attach fp[0] (it is the first of registers - >>parameters >> -- of this procedure) to the input register of >>incr/decr. >> -- The output register of incr/decr attach to the >>first local >> -- register. >> (auInc[0], lv[0]) (auInc[1], fp[0]) >> >> -- The first local register will contain n-1, >> -- the second one will contain the result of >>recursive call. >> (lv[0], dx1[0]) (lv[1], dx1[1]) >> >> -- This attach the output of our multiplier (n * >>fact (n-1)) >> -- to fp[1]. Really fp[x] it is either a memory >>cell >> -- in the caller stack or a register if our >>optimizer is >> -- a lassie. It is why it is named "secondary (or >>virtual)" >> -- selector. Any virtual register is like a >>deference. >> (auMul[1], lv[1]) (auMul[0], fp[0]) (auMul[2], >>fp[1]) >> end map; >>begin >> if fp[0] then >> -- It is imperfection of current machine - we need >> -- awake decrementor to make its outputs updated. >> * auInc; >> >> -- dx1 will be substituted by fp when th procedure >>calls. >> -- Theses lv and dx1 will not be able to access >>there. >> call dx1, :fact; >> >> -- Synchronize impuls to multiplier >> * auMul; >> else >> -- This branch is for the case of fact(0) = 1. >> -- Moves '1' into a register which is "hided" >>behind >> -- the virtual fp[1]. >> fp[1] <- ct[0]; >> end if; >> >>end :fact; >> > > >__________________________________________________ >Do You Yahoo!? >Yahoo! Greetings - send holiday greetings for Easter, Passover >http://greetings.yahoo.com/ > >_______________________________________________ >quirks-UVM-devel mailing list >qui...@li... >https://lists.sourceforge.net/lists/listinfo/quirks-uvm-devel > |
From: Bhavani M. <bha...@ya...> - 2002-03-29 14:16:19
|
> Date: Thu, 28 Mar 2002 14:00:09 -0800 (PST) > From: bhavmus m <bh...@ya...> > Subject: query on quirks examples > To: qui...@li... > > > Hi, > > I have got the following questions after going > through the simple example. > > > 1. usage of fp[0], fp[1] is little bit confusing. I > am thinking these are the procedure parameters and > can be used for procedure INPUT or OUTPUT > 2. why can not we declare the ct value in the > fact.ua file? > 3. I am able to understand the declaration of > registers, but not the actual mapping done below. > map is > (auMul[1], lv[1]) (auMul[0], fp[0]) (auMul[2], > fp[1]) > end map; > 4. I want to have some more explanation for *act > command. > > 5. I have gone through the fibonacci example too. it > is easy compared to factorial. In this example also > I did n't get the > purpose of mapping lv[3] twice. Why do we need auSum > register, even though we have the actual result in > lv[2]? > > > procedure :Fibonacci is > lv is <int32/inout int32/inout int32/inout > int32/inout stu>; > > declare map > auInc is <int32/out int32/in stu>; > auSum is <int32/in int32/in int32/out stu>; > map is > (lv[3],auInc[0]) > (lv[3],auInc[1]) > (lv[0],auSum[0]) > (lv[1],auSum[1]) > (lv[2],auSum[2]) > end map; > begin > lv[3] <- fp[0]; > lv[0] <- ct[0]; > lv[1] <- ct[1]; > > loop > * auInc; > lv[0] <- lv[1]; > lv[1] <- lv[2]; > until not lv[3]; > > fp[1] <- lv[2]; > > end :Fibonacci; > > > > > > > procedure :fact is > -- Make two 32 bit local registers. > -- Each register is both writeable and readable. > lv is <int32/inout int32/inout stu>; > > declare map > -- Get access to two registers of > incrementer/decrementer > auInc is <int32/out int32/in stu>; > > -- Make two virtual registers (they are simple > "ports" > -- and now they are attached to nothing). > dx1 is <int32/in int32/out stu>; > > -- Three ports of multiplier > auMul is <int32/in int32/in int32/out stu>; > map is > -- Attach fp[0] (it is the first of registers - > parameters > -- of this procedure) to the input register of > incr/decr. > -- The output register of incr/decr attach to the > first local > -- register. > (auInc[0], lv[0]) (auInc[1], fp[0]) > > -- The first local register will contain n-1, > -- the second one will contain the result of > recursive call. > (lv[0], dx1[0]) (lv[1], dx1[1]) > > -- This attach the output of our multiplier (n * > fact (n-1)) > -- to fp[1]. Really fp[x] it is either a memory > cell > -- in the caller stack or a register if our > optimizer is > -- a lassie. It is why it is named "secondary (or > virtual)" > -- selector. Any virtual register is like a > deference. > (auMul[1], lv[1]) (auMul[0], fp[0]) (auMul[2], > fp[1]) > end map; > begin > if fp[0] then > -- It is imperfection of current machine - we need > -- awake decrementor to make its outputs updated. > * auInc; > > -- dx1 will be substituted by fp when th procedure > calls. > -- Theses lv and dx1 will not be able to access > there. > call dx1, :fact; > > -- Synchronize impuls to multiplier > * auMul; > else > -- This branch is for the case of fact(0) = 1. > -- Moves '1' into a register which is "hided" > behind > -- the virtual fp[1]. > fp[1] <- ct[0]; > end if; > > end :fact; > __________________________________________________ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/ |
From: Sergei L. <sl...@is...> - 2002-03-27 13:32:16
|
Hello Bhavani. I send a well commented example of Quirks procedure for recursive find a factorial with this letter. Try look into it. I propose you get any another simple algorithm and write tiny program for Quirks, compile and try execute it. See in the directory quirks-uvm/benchmarks - I meen another example like it. It gives you better understanding of this VM. I am ready for you questions :) Ask so many as you will have. Bhavani Malladi wrote: >Hi sergei, > I am able to build the code in vc++ without >problems. > -- Sergei. |
From: Bhavani M. <bha...@ya...> - 2002-03-26 20:34:00
|
Hi sergei, I am able to build the code in vc++ without problems. Previously I tried to make workspace for the assembly directory files. Now I used your workspace which is placed in win/Quirks directory. Thanks bhavmus __________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ |
From: <te...@us...> - 2002-03-26 16:06:05
|
Hello Bhavani. I've checked version from Web site (cvs-pre1_win). In the workspace Quirks_UVM it is compiled without errors under MSVC++ 6.0 both in Debug and Release configurations. I see the settings for the file mimic.c. "preprocessor" in the "C/C++" tab. It is: ..\lib,..\..\win The directory ..\lib\uvm contains the file "common.h". So, I can't answer your question. My variants are: - you use another version of Visual Studio (?); - you compile the project not from visual environment, (i.e. not by F7); - maybe some global options cause this effect (but I don't know such situations). Try change <...> to "..." or set the absolute path into preprocessor settings to figure out where is the bug. It is not a problem you work in VC++. It is more comfortable under Windows then cygwin. But in this case I propose you some responsibility for VC++ build becouse I do main development under Linux and will use VC++ only for test release versions (as well as cygwin and AIX). Let me know what is wrong in my VC++ build. P.S. Now I propose you write me on this address: qui...@li... (i.e., in this list). -- Welcome, Sergei |
From: <sl...@is...> - 2002-03-26 16:03:29
|
Hello Bhavani. I've checked version from Web site (cvs-pre1_win). In the workspace Quirks_UVM it is compiled without errors under MSVC++ 6.0 both in Debug and Release configurations. I see the settings for the file mimic.c. "preprocessor" in the "C/C++" tab. It is: ..\lib,..\..\win The directory ..\lib\uvm contains the file "common.h". So, I can't answer your question. My variants are: - you use another version of Visual Studio (?); - you compile the project not from visual environment, (i.e. not by F7); - maybe some global options cause this effect (but I don't know such situations). Try change <...> to "..." or set the absolute path into preprocessor settings to figure out where is the bug. It is not a problem you work in VC++. It is more comfortable under Windows then cygwin. But in this case I propose you some responsibility for VC++ build becouse I do main development under Linux and will use VC++ only for test release versions (as well as cygwin and AIX). Let me know what is wrong in my VC++ build. P.S. Now I propose you write me on this address: qui...@li... (i.e., in this list). -- Welcome, Sergei |
From: Sergei L. <s_l...@ya...> - 2002-02-08 12:54:22
|
Yesterday I make a UML model of Quirks available at http://quirks-uvm.sourceforge.net/UML-Model/model.html . There is a little information there yet (now it is contains only 2 diagrams which describe a quirks backend), but I will try keep it up-to-date. Sergei. |
From: Sergei L. <sl...@is...> - 2001-11-06 14:26:05
|
Hi. `Quickest Guide' and `UVM command set' documents was updated. Mainly this update address the second document. Now it is up to date with the current development. Changes in `UVM command set': 1.Missing `mov' instruction was added. 2. Now we have 3 jump instructions: jmp, jz and jnz. Conditional jumps (jz and jnz) accepts cells instead of selectors. 3. All usage of selectors in conditional instructions was replaced by cells. Sergei Lodyagin. |