00:00:00 --- log: started retro/10.01.05 01:23:46 --- join: SimonRC (n=sc@fof.durge.org) joined #retro 01:50:26 Hi SimonRC 01:52:53 so I figure, someone has to design the super bloated forth cpu, I might as well try at that too. I am up to 164 reasonably justifiable instructions. But I havent added anything for floating point. Or single instruction double or multi precision. Yeah, those should get me up past 256 instructions... 01:54:58 I even have 2rot and "if top of R is less than or equal to zero, increment it and jump; if it is greater than zero, pop R and goto next instruction." A mutant version of the reasonable djnz/next instruction. 02:37:56 more performance/statistics spam. Now about stack depths. Looks like Chuck is right "32 is practically infinite" 02:37:59 times seen | data stack depth 02:37:59 351366 | 0 02:37:59 2205028 | 1 02:37:59 4120378 | 2 02:37:59 5838941 | 3 02:38:00 3915009 | 4 02:38:02 6594912 | 5 02:38:04 3608411 | 6 02:38:06 1807180 | 7 02:38:08 424459 | 8 02:38:10 58903 | 9 02:38:12 6132 | 10 02:38:14 02:38:16 times seen | return/address stack depth 02:38:18 3 | 0 02:38:20 14468 | 1 02:38:22 96552 | 2 02:38:24 2982104 | 3 02:38:26 5360432 | 4 02:38:28 8830370 | 5 02:38:30 7092486 | 6 02:38:32 2797692 | 7 02:38:34 324145 | 8 02:38:36 580155 | 9 02:38:38 575714 | 10 02:38:40 187700 | 11 02:38:42 35969 | 12 02:38:44 46149 | 13 02:38:46 6780 | 14 02:40:20 I think I'll still stick with 64 on my chips. Rings too, no stacks for me, they have ends. 03:24:02 --- join: Mat2 (i=5b43e0e4@gateway/web/freenode/x-spjakculvczmfsjf) joined #retro 03:24:09 hello 03:28:48 Hello Mat2 03:29:28 You have a (partially) native compiling retro? 03:30:06 j@js4: I have experimented with a interpreter some time ago which uses a vliw alike instruction format featuring two 3 bit and one 2 bit field as opcode bundle. The last 2-bit slice was bound to load/store 03:31:22 interesting. I've been exploring in the other direction, is there a set of 16 instructions that aren't stuck in the turing tar pit. I'm also interested in designing and building a real hardware cpu ro tun my instruction set eventually. 03:31:57 So I've been instrumenting ngaro (the console version of the vm) and getting some data I think is really cool. 03:32:18 operations, the first two 3-bit slices to arithemetic and logic operations. This way tree opcodes can be fetched in one interpeter iteration. 03:33:17 Nice. I was looking at packing short opcode multiple to a cell. I found out that between jump/call/return opcodes there is an average of 2 other opcodes. 03:33:39 the distribution has a dit at 3, and a sharp knee down at 6. 03:33:45 dip at 3 03:34:28 sounds good. 03:34:28 So the implication is trying to pack 11 3 bit opcodes into a 32bit cell is a joke. 5 6 or even 8 bit opcodes look like they are OK though. 03:35:05 The conclusion doesn't apply to vliw though. Haven't thought about that much... the haris opset makes my head hurt ^_^ 03:35:23 (haris?... hmmm the novix... Chucks first forth computer) 03:35:50 the main reason for 3-bit opcode slices was simply to dispatch all combinations though a 256 element jump table 03:36:16 Have you looked at it? It kinda feels "vliw-ish" to me. 03:36:26 Hmmmm... 03:36:39 8 alu opcodes? 03:36:42 I have studied the designs at "stack cpus, a new wave" 03:37:40 yes, add, shl, shr, div, and, or, cmp, cond 03:37:47 The distribution of opcode usage, about 20% of the instructions executed are return, makes me a beliver in that part of the design. A bit in each op for "and then return." 03:37:56 cond? 03:38:20 conditional execution (just like the condition field in ARM cpu's) 03:38:34 Cool 03:38:38 1513724 | 1 | VM_LIT 03:38:38 1739925 | 4 | VM_SWAP 03:38:38 1840574 | 2 | VM_DUP 03:38:38 3939307 | 9 | VM_RETURN 03:38:38 3944749 | 7 | VM_CALL 03:39:17 most popular VM instructions by number of times executed (when metacompiling the core) 03:39:37 not surprising for a stack based vm 03:39:41 so "shl if cond" ? 03:39:49 yes 03:40:02 nope, not at all. Though it turns out most of that is from string compare. 03:41:03 this bugged me the other day: chuck's opcode is "2/" but -1 2/ is -1 not 0. 03:41:18 because it's really arithmetic shirft right. 03:42:00 lhmm, that's strange 03:42:37 the only place arsh != divide by 2 is at -1 03:43:07 right 03:43:29 anyway... 03:44:38 that remind me of some tricks one can use with early motorola cpu's (6800) 03:45:03 oh, jumps... the maximum displacements i've seen are -33 and +19. A result of it being forth again. 03:46:00 I never did 6800 assembly v.v. pdp10, z80, then x86... I don't really like 8's 03:47:12 the result of shift operation was dependent on some bits of the flag register (it was a bug) 03:47:36 wow! what was the bug/trick? could you make arsh do 2/? 03:48:41 fthe result was inverted if the carry flag was set (if I remebered correctly). 03:49:39 lol, when I looked at what constats were used, the most popular was.... 6. More than twice as common as 0. That led to finding a speedup in the string compare routine. Now 60% of the constats are either -1, 0 or 1. 03:49:40 Iit was a strange effect 03:49:55 huh... so 1 << 1 was like -3? 03:50:15 yes 03:50:19 funny 03:52:24 what are your plans for your hardware version ? Will you use a FPGA or CPLD ? 03:53:22 I already coded the verilog for the first version of my chip, 16 instructions. Tested with some fpga companies tool chain. 03:53:45 I will prolly make my first version with fpga. But I don't know anything about cpld. 03:53:53 * js4 pokes wikipedia 03:56:19 huh, interesting. I dunno. I'll prolly get a popular and cheap devkit to base it around. There are a few things in the 200-300 USD range that look good. That was about a year ago. Probably even cooler these days. 03:58:09 CPLD is much trickier because more SPLD's are needed for alu logic and there number is limited compared to FPGA cell's. One advantage is, there configuration depend resitend 03:59:45 I heard the altera boards are inexpensive but I hope far less than 300 USD 04:00:54 The coolrunner II CPLD Starter Kit cost's 40 USD 04:01:23 --- join: crcx (i=d8012b82@gateway/web/freenode/x-bfynvhrxagwcfohm) joined #retro 04:01:40 hi 04:02:16 hi 04:02:18 wow, $40?!!! 04:02:24 Hi crc 04:02:40 got stack depth tracing done. you have history there? 04:03:27 @js4: yes, but implement a cpu with this limited CPLD is not easy 04:03:36 http://www.opalkelly.com/products/xem3010/ 04:04:01 implement a cpu ... heck 1980's level micro, not so hard with one of those. 04:05:59 linteressting 04:06:23 * Mat2 must clean his keyboard one day * 04:06:25 yep, $40. but bet it doesn't have 32MB of sram and usb... 04:06:32 http://www.xilinx.com/products/coolrunner2/index.htm 04:08:11 yes, no sram, buti know an usb adapter exist in some way 04:08:31 but still... only $40... and my baby only has 3 alu instructions: arsh, xor, nand... 04:09:57 * Mat2 take a quick look at the data sheed * 04:11:06 http://www.xilinx.com/products/devkits/HW-SPAR3AN-SK-UNI-G.htm 04:11:29 the XC2C512 CPLD has 512 Macrocells, that can be nough for a simple 8 bit stack cpu 04:11:38 that's more like it. only 200, reasonable io and memory. kinda low on the clock speed... 04:12:41 See, I wanna build a forth computer, not a forth cpu. I want keyboard, mouse, colorfull graphics... 04:12:56 anyway... let me see if I'm ready to push my changes... 04:14:13 look at this: http://experiment-s.de/de/atari-ste-in-a-chip/ (but it's in german) 04:15:02 crc: ohyeah, got tracking on displacements of if/jumps. Now do calls, jumps, literals, opcode, slcb, and stack depth. Getting close to done... 04:15:28 ok, must work, ciao js4 & crc 04:15:39 See ya Mat2:! 04:15:54 the mode of the stack depts is 5. The max is about 15 elements on the return/address stack. 04:16:00 --- quit: Mat2 ("Page closed") 04:18:30 This is enough for a forth computer ... for everything. Just needs a little software added, the hardware is all there. 04:18:33 # Memory 04:18:33 04:18:33 * 4 Mbit Platform Flash PROM 04:18:33 * 32M x 16 DDR2 SDRAM 04:18:33 * 32 Mbit parallel Flash 04:18:33 * 2-16 Mbit SPI Flash devices 04:18:35 04:18:37 # Analog Interface Devices 04:18:39 04:18:41 * 4-channel D/A converter 04:18:43 * 2-channel A/D converter 04:18:45 * Signal amplifier 04:18:47 04:18:49 # Connectors and Interfaces 04:18:51 04:18:53 * Ethernet 10/100 PHY 04:18:55 * JTAG USB download port 04:18:57 * Two 9-pin RS-232 serial port 04:18:59 * PS/2-style mouse/keyboard port 04:19:01 * 15-pin VGA connector capable of 4,096 colors 04:19:37 cool 04:19:50 $200. Just add software. 04:23:46 [js4/ngaro] 3da987: Track jump displacements. With --callstats also s... 04:24:45 [js4/retro10] ccf303: slightly faster compare; thanks js4 04:27:59 Oh, I didn't get it when you mentioned it yesterday... just looked at the difs. Nice way to solve that issue. Keep the clean factoring *and* get the speed up. 04:51:16 --- join: Mat2 (i=5b43e0e4@gateway/web/freenode/x-eixroqaowbxlumcx) joined #retro 04:51:48 two remarks: 00000010b neg = 11111101b 04:52:55 what means arse ? 04:53:10 --- quit: Mat2 (Client Quit) 05:12:55 00000010b negated is 11111110b. inverted is 11111101b. 05:25:54 [crcx/ngaro] 3da987: Track jump displacements. With --callstats also s... 05:35:05 Hopefully there's not whitespace goofs or other anoyances... but it is other people's code after all... 05:57:37 looks ok to me so far 06:25:50 [crcx/retro10] 63808f: minor reformatting of compare 07:00:26 --- quit: virl (Remote closed the connection) 07:52:47 [js4/retro10] c1a9ed: minor reformatting of compare 09:02:33 --- join: crc___ (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #retro 09:02:33 --- mode: ChanServ set +o crc___ 09:02:34 --- quit: crc (Read error: 104 (Connection reset by peer)) 09:02:52 --- nick: crc___ -> crc 09:15:44 wb crc 09:19:32 connection issues on the mac 09:19:40 v.v 09:19:41 * crcx is at work currently 09:39:43 --- quit: crc (Read error: 104 (Connection reset by peer)) 09:40:09 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #retro 09:40:09 --- mode: ChanServ set +o crc 09:44:00 --- quit: crc (Read error: 104 (Connection reset by peer)) 09:44:04 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #retro 09:44:04 --- mode: ChanServ set +o crc 09:54:46 wb crc. Bad news. Emacs has a hard time reading a retroimage. How small are they when --shrink is used? 09:57:29 oh, that's not bad at all... 10:05:03 my home machine is having serious issues with network performance. even an ssh connection is dragging :( 10:05:34 stinky! 10:21:06 --- quit: crc (Read error: 110 (Connection timed out)) 10:24:45 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #retro 10:24:45 --- mode: ChanServ set +o crc 10:30:38 --- quit: crc (Read error: 104 (Connection reset by peer)) 10:31:35 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #retro 10:31:35 --- mode: ChanServ set +o crc 10:37:01 *giggle* 10:37:02 (ngaro-load-image "c:/cygwin/home/Jay/src/forth/retro/git/retro10/retroImage") 10:37:02 "Loading image done." 10:37:02 (length ngaro-mem) 10:37:02 9900 10:37:02 (aref ngaro-mem 0) 10:37:03 8 10:37:05 (aref ngaro-mem 1) 10:37:07 2489 10:40:00 --- quit: crc (Read error: 104 (Connection reset by peer)) 10:41:41 nice 10:42:45 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #retro 10:42:45 --- mode: ChanServ set +o crc 10:43:11 I wonder if/when it will blow up. my elips only has 30 bit cells for Ngaro to use. 10:43:16 30bit ints 10:43:25 no... 29 10:52:09 --- quit: crc (Read error: 60 (Operation timed out)) 10:52:57 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #retro 10:52:57 --- mode: ChanServ set +o crc 11:07:40 29 bits should be ok 11:10:15 --- quit: crc (Read error: 110 (Connection timed out)) 11:17:44 --- join: nigol (n=nigol@63.120.broadband10.iol.cz) joined #retro 11:18:01 hi everybody 11:18:07 hi nigol 11:18:55 crcx: hi 11:20:21 crcx: I have question...Why vline and hline in canvas.retro aren't implemented in forth? Speed reasons? 11:20:28 yes 11:21:34 Hi Nigol 11:21:42 crcx: Ok so I will implement it in MIDP on VM side as well. 11:21:46 js4: Hi 11:22:48 btw. new midp vm starts to be quite usable for now. I hope ;) 11:24:07 * crcx has been using it 11:24:22 --- quit: retro-commit (Read error: 110 (Connection timed out)) 11:25:28 But I'm not sure, if circle drawing is supported directly on midp. I could implement this with goniometric fns, but I'm not sure about speed... 11:26:06 I have code in C for drawing circles using only a putpixel function 11:28:03 crcx: I will look in javadoc form midp classes first and let's see. 11:28:14 ok 11:29:11 I'm thinking about mouse emulation too, but I'm not sure if it is useful on mobile device... 11:58:21 --- part: nigol left #retro 13:44:04 --- join: erider (n=chatzill@unaffiliated/erider) joined #retro 13:44:39 hi 13:55:50 erider: I'll be home in 2 hours 13:56:30 crcx: see you later because I have some questions for you 13:56:58 erider: email if you don't want to wait :) 13:58:43 crcx: nah because it is Q&A that I need :) 14:00:09 ok 14:00:26 bbl 14:00:46 --- quit: crcx ("Page closed") 15:59:44 --- join: virl (n=virl__@chello062178085149.1.12.vie.surfer.at) joined #retro 16:03:02 Hi virl 16:03:12 hi 16:04:10 well, I have a first cut at a ngaro port. Runs the image OK so far... 16:04:14 a little slow... 16:04:20 I ported it to emacs lisp 16:22:28 --- quit: virl ("Verlassend") 17:12:23 --- join: docl (n=luke@97-120-215-229.ptld.qwest.net) joined #retro 17:13:20 * docl is back from work 17:13:34 emacs lisp port of ngaro? seriously? 17:18:48 * docl needs to put some more attention towards that tcl port 17:19:50 yep, seriously... 17:21:05 Didn't take too long either.... but it's not really done. The issues are 1: testing 2: hosting. I haven't tested it very much. 2: It doesn't save an image, and it is *very* impolite to the rest of emacs as far as input goes. 17:21:22 But that's all fixable. 17:21:41 (ngaro-run-image "c:/cygwin/home/Jay/src/forth/retro/git/retro10/retroImage") 17:21:41 RETRO 10 17:21:41 17:21:41 ok words see set-blocks ea e new [...] and drop swap 1- 1+ 17:21:41 ok : bar pop dup push ; 17:21:41 ok : foo bar ; 17:21:43 ok : cow ; 17:21:45 ok see bar 17:21:47 7432 nop 17:21:49 7433 nop 17:21:51 7434 pop 17:21:53 7435 dup 17:21:55 7436 push 17:21:57 7437 ; 17:21:59 ok see foo 17:22:01 7445 nop 17:22:03 7446 nop 17:22:05 7447 call 7432 ( bar ) 17:22:07 7449 ; 17:22:09 ok foo 17:22:11 ok . 7448 17:22:13 ok bye nil 17:22:32 That is all cut and paste from the other frame of this emacs (my irc client is also emacs.) 17:28:21 it does suffer from being a 29 bit implementation rather than a 32bit one. 17:36:55 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #retro 17:36:56 --- mode: ChanServ set +o crc 17:38:04 ok, I think I got the router working again 17:38:18 Yay! 17:38:50 * crc should get a real internet connection one day and stop using open wifi networks 17:39:44 So I may have a bug to report... 17:40:03 please share 17:40:26 (ngaro-run-image "c:/cygwin/home/Jay/src/forth/retro/git/retro10/retroImage") 17:40:27 RETRO 10 17:40:27 17:40:27 ok words see set-blocks ea e new [...] and drop swap 1- 1+ 17:40:27 ok : bar pop dup push ; 17:40:27 ok : foo bar ; 17:40:29 ok : cow ; 17:40:31 ok see bar 17:40:33 7432 nop 17:40:35 7433 nop 17:40:37 7434 pop 17:40:39 7435 dup 17:40:41 7436 push 17:40:43 7437 ; 17:40:45 ok see foo 17:40:47 7445 nop 17:40:49 7446 nop 17:40:51 7447 call 7432 ( bar ) 17:40:53 7449 ; 17:40:55 ok foo 17:40:57 ok . 7448 17:40:59 ok bye nil 17:41:12 look at the last # printed. It's not 7449, so the # on the top of rsp does not point to the next word to execute. Is that by design? 17:43:13 it's a side effect of the way I implemented the vm loop 17:44:42 ok, all the VM's be have the same way then? In that case I have an almost useless speedup in the consol vm. 17:44:54 all vms behave the same way 17:45:18 This, from VM_CALL, doesn't need a ++. 17:45:20 TORS = vm->ip++; 17:45:45 x=1; y=x++; // y == 1 17:46:03 x=1; y=++x; // y==2 17:47:15 good point 17:48:16 And it's why I wasn't sure if I was looking at a bug or not... anyway, I'll take it out, and test for a bit before I check in the change. Probably makes no difference except to someone reading the code. 17:48:40 hmm, crashes after I stripped that out 17:49:05 well, I could be wrong.... 17:49:58 Oh, if you take it out you have to change the ip-1 below 17:50:00 heh, I had to change one more lineL 17:50:01 - vm->ip = vm->image[vm->ip-1] - 1; 17:50:01 + vm->ip = vm->image[vm->ip] - 1; 17:50:08 yep 17:51:29 back in about 20... I'll prolly check in a .el version of ngaro tonight or tomorrow. 17:52:01 --- join: retro-commit (n=Karere@c-68-80-139-0.hsd1.pa.comcast.net) joined #retro 17:52:01 [crcx/ngaro] 57526a: minor speedup from js4 17:52:01 [crcx/ngaro] aeabf3: fix console vm 17:52:01 [crcx/ngaro] 834331: apply change from js4 to sdl port 17:52:25 what is sdl? 17:52:35 sdl = simple directmedia layer 17:52:43 a library I use for simple graphics 17:52:52 ok 17:53:00 bbiab 17:53:11 sdl port = code in graphical directory under ngaro 17:53:18 erider: still here? 17:56:16 the sdl port is actually the oldest implementation of ngaro, though I did change the way the graphics and text display were handled over the last couple of months 17:57:05 sort of 17:58:34 I'm sorry to be arriving back so late. Got tied up after work, then had to fix some router issues here before I could connect 18:00:42 no worries 18:00:54 I am trying to figure it out 18:12:49 what is the problem? 18:57:28 crc: I am trying to view what a structure looks like in asm 18:57:54 what structure? 18:58:31 structures in a program that I am debugging 18:59:59 bytes/chars are 8 bit, so 'db', words/shorts are 16-bit, so 'dw', dwords/32 bit ints are 'dd', others fall outside the scope of my use of assembly now 19:00:28 but cdb is complaining about symbols 19:01:32 depending on os and compiler, there may be padding between items in the structure too 19:01:51 * crc is not familiar with cdb 19:06:52 its a symbols thing 19:24:53 [crcx/ngaro] 18c242: add js4 improvement to libretro 19:25:53 [crcx/ngaro] e676cf: and to C# .NET implementation 19:27:54 [crcx/ngaro] f145be: and to javascript implementation 19:28:53 [crcx/ngaro] 017250: and to java port 19:29:06 ok, js4's improvement is now part of all vm implementations 19:30:32 --- quit: erider ("ChatZilla 0.9.86 [Firefox 3.5.6/20091201220228]") 19:33:20 cool 19:45:01 [crcx/ngaro] 90e4e9: update image for MIDP to current 19:45:56 Yeah! I still think it amounts to updating the comments... maybe you shave a few instruction cycles... though it is call so the cycles will add up... 19:46:15 a few cycles counts on things like the javascript port 19:47:10 Yeah, I am taking a good long slow close look at my el port. It runs slow, but bearable, when running interpreted elisp. Should go somewhat faster compiled. 19:47:41 elisp compiles to bytecode... 19:59:38 hmmmm the input to retro in emacs is really hard to do right... 21:35:34 Oh, that's a bad bug.... 21:36:28 ok : bug 3 3 ok bug bug 21:37:26 ok see bug 21:37:26 7460 nop 21:37:26 7461 nop 21:37:26 7462 lit 3 ( heap ) 21:37:26 7464 lit 3 ( heap ) 21:37:26 7466 >jump 7478 21:37:28 7468 jump 7474 21:37:30 7470 Unknown: 98 'b' 21:37:32 7471 Unknown: 117 'u' 21:37:34 7472 Unknown: 103 'g' 21:37:36 7473 nop 21:37:38 7474 lit 7470 21:37:40 7476 call 540 ( type ) 21:37:42 7478 ; 21:40:28 >jump is the implementation for <=if. 21:42:44 the vm should have vm_lt_jump, vm_le_jump, vm_eq_jump, and vm_ne_jump. 21:44:01 Then you can do "swap vm_le_jump" to implement " or you can use two jumps and the instruction set you have now... 21:45:23 " 2dup >jump =jump" 21:47:09 "2dup >jump 222 =jump 222 call foo (adress 222)" 21:47:42 oh yeah, or the jump over... 21:48:23 " that's prolly the easiest fix, and I think this code is pretty close: 22:23:51 t: t->if ( R: xy- C: -a ) 22:23:51 10 # t-, here 2 # + t-, 8 # t-, (if) ; 22:23:51 t: t- 11 # t-, here 2 # + t-, 8 # t-, (if) ; 22:24:11 ooops, t-here... 22:38:09 I am getting the feeling though that the + won't work in meta compilation 23:59:59 --- log: ended retro/10.01.05