2022-04-06 08:20:30 I have vocabularies implemented and I think forget works fine 2022-04-06 08:20:48 but now I struggle a bit with the return stack 2022-04-06 08:21:12 What's the struggle? 2022-04-06 08:21:37 the thing is, words are arrays not memory locations, when you pop the return stack you can increment the ip as they are consecutive 2022-04-06 08:22:05 but as they're arrays I suppose I need to keep track of the current word being executed too 2022-04-06 08:22:41 Yep the array & index or just a pointer to current element would be needed 2022-04-06 08:22:44 If I understand you right 2022-04-06 08:22:58 haha sorry I try to understand my problem 2022-04-06 08:23:01 pointer/address 2022-04-06 08:23:24 https://termbin.com/qqa3 I have this, there are some comments idk if it's readable 2022-04-06 08:23:38 it just implements the dictionary and vocabularies 2022-04-06 08:24:05 and search which gives you the index of the word you want in the @dictionary array by looking at vocabularies in order 2022-04-06 08:24:23 and forget which removes the words and "updates" the vocabularies too 2022-04-06 08:24:50 now I need the return stack but I suppose I just need to keep track of the current word being excute 2022-04-06 08:29:09 I'll try it that way 2022-04-06 08:30:42 I have no idea about how to implement branch and alike, but need to get the return stack right first 2022-04-06 08:31:37 I have to go, ty veltas I think you helped me :D 2022-04-06 08:42:15 Well, I managed to successfully change my header layout as previously discussed. 2022-04-06 08:42:47 It was about the difficulty level I figured it would be - should have been simple but I hadn't been as "clean" as I ought to have, so a few things had to be chased down. 2022-04-06 10:31:33 h'lo folks, one BitGrid related idea: for visualization of config show the bitgrid cells as 8x8 pixel bitmap tiles 2022-04-06 10:32:15 each such tile is split up into four 4x4 quadrants 2022-04-06 10:33:06 the quadrants are arranged thus: N E \n W S 2022-04-06 10:33:38 So it was clear that BitGrid mapped the config RAM into standard RAM space externally accessible. I didn't see that it said anything about the cell outputs, but it seems reasonable that that would be mapped into an additional section of RAM, right? 2022-04-06 10:33:47 That would be 4 bits per cell. 2022-04-06 10:34:08 each quadrants is the 16 bit LUT contents for that output 2022-04-06 10:34:11 So a much smaller section of RAM. But you'd still want to be able to know "the state," it seems. 2022-04-06 10:34:29 Although I guess given that the cells are deterministic you could calculate the outputs from the config easily. 2022-04-06 10:34:37 So maybe you wouldn't have extra hardware for that. 2022-04-06 10:34:50 That might be a large calculation, though. 2022-04-06 10:36:57 KipIngram: not nescicarely, if you do not mind 'gaps' in your address space 2022-04-06 10:37:04 Also, were any clocks mentioned? You can think of this thing being either sequential or combinational. 2022-04-06 10:37:37 no clocks so I am assuming asynchronus 2022-04-06 10:37:55 That's what I thought too, though the idea works either way. 2022-04-06 10:38:14 Just a "sea of gates," with the gates "fully flexible." 2022-04-06 10:38:33 Each "gate" can implement any Boolean function of its inputs. 2022-04-06 10:38:36 better without the clocks as they are limiting factor in many of todays fpgas iirc 2022-04-06 10:38:53 Yeah, it seems more "pure" without the clocks. 2022-04-06 10:39:26 each BitGrid cell is a four input four output combinational device 2022-04-06 10:39:28 And if you had a clock, you'd be expecting it to be uniform across the array, and that can be hard to engineer. 2022-04-06 10:39:35 Right. 2022-04-06 10:39:50 So yeah, four flexible gates. 2022-04-06 10:40:35 re visualization: I have not decided on how the 4x4 quadrant bitmaps are laid out 2022-04-06 10:40:52 It really strikes me as a sea of gates FPGA taken to the full extreme. And with the config RAM accessible in a fully general way, it really does offer some very interesting notions of "dynamic evolution." 2022-04-06 10:41:07 You could re-write the config while it ran. 2022-04-06 10:41:16 Or parts of the config. 2022-04-06 10:41:38 I've wished for a while that FPGAs would let you do that. 2022-04-06 10:41:39 which means that you can have signals/wires crossing over each other, etc 2022-04-06 10:42:32 some Xilinx fpgas allow for that but it is hard because their bitstreams are not open spec 2022-04-06 10:42:35 The neighbor-to-neighbor connects would be pretty straightforward - it would be getting the address and data lines in and out for reading/writing the config that might get nasty. 2022-04-06 10:42:50 I know, and that bugs the hell out of me. 2022-04-06 10:43:02 Do they want people to use their parts or not? 2022-04-06 10:43:17 The way to promote use is to make the things as easy to use in as many ways as possible. 2022-04-06 10:43:28 I think they want to monetize the tool chain too. 2022-04-06 10:43:40 And I guess they worry that that info might allow competitors to reverse engineer. 2022-04-06 10:43:45 re config lines routing, I am thinking Hilbert curve routing 2022-04-06 10:44:44 that might be one of their concerns 2022-04-06 10:46:00 but also there is option of encrypting the bitstream with aes which the fpga then decrypts using its inbuilt aes engine 2022-04-06 10:46:40 that aes engine is also available as a hard block in the fpga btw 2022-04-06 10:47:06 Sure - I just meant that telling us which bits of the stream did what might reveal clues about the internal architecture. 2022-04-06 10:47:50 this is understandable as many IntProp heavy companies do not want their trade secrets to abscond to their competion 2022-04-06 10:48:07 I've gotten an itch the last few days to do some FPGA work again. I've been looking at eval kits online. 2022-04-06 10:48:44 I heard of Symbiflow the open source project has a good listings of such 2022-04-06 10:49:03 I just installed that yesterday and ran through some of the examples. 2022-04-06 10:49:15 It installed easy and just in general didn't complain about anything. 2022-04-06 10:49:29 There were a good number of steps in the install, though. 2022-04-06 10:49:45 I was really happy to see that we have open source toolchains now. 2022-04-06 10:50:17 I'm really just a fan of *anything* that chinks away at the grips the big corporations have us in. 2022-04-06 10:50:27 the funny thing is that Xilinx basic toolchain is availablr freely which means that some hackers have been reverse engineer the bitstream via basic oracle attacks 2022-04-06 10:50:58 You know, if those guys would just get a job they could be great engineers. 2022-04-06 10:51:02 They're plenty smart. 2022-04-06 10:51:37 oh, these guys have jobs. The hacking is just side hobby 2022-04-06 10:51:41 I remember when I saw how Spectre/Meltdown worked I was really impressed. 2022-04-06 10:51:48 :-) 2022-04-06 10:52:29 plus EULAs are quite unenforcable in many polities 2022-04-06 10:52:47 Good. They've taken those things way to far. 2022-04-06 10:53:23 Oh, my wife told me last night that the coming trend in cars is that they want to make operation of features like heated seats and stuff a *subscription service*. 2022-04-06 10:53:24 but the funny thing is that copyright licenses like GPL are 2022-04-06 10:53:30 That just blew my mind. 2022-04-06 10:54:08 They actually want you to pay the for having the feature in your car and then pay them every month for the privilege of using it. 2022-04-06 10:54:47 I would not buy such a car, but perhaps long term rent one 2022-04-06 10:55:06 but then again I do not like driving 2022-04-06 10:55:08 I know - me either. But the idea itself just struck me as so over the top I could hardly believe it. 2022-04-06 10:55:24 Greed knows no bounds. 2022-04-06 10:55:56 at least commuting via public transport I can read or listen intently to podcasts or audiobooks 2022-04-06 10:56:04 Sure. 2022-04-06 10:56:26 I do like driving my car, but I wouldn't go drive it around just for fun very much. 2022-04-06 10:56:54 so, does the car contact some digital restriction management server at every start or? 2022-04-06 10:56:59 I just took it in for some body work yesterday. I've driven around with an ugly caved in corner on the back bumper for the last year and a half or so. 2022-04-06 10:57:11 Just took that long to feel like enough surplus money was on hand. 2022-04-06 10:57:22 Because... there's always something. 2022-04-06 10:57:49 So I'm looking really forward to having her all shiny and beautiful again. :-) 2022-04-06 11:00:21 re BitGrid: I am longing/hoping that such chips would become as jellybeanish as the 7400's and such chips are 2022-04-06 11:00:39 Yes - that would be great. 2022-04-06 11:00:54 I think there's huge creative opportunity available there. 2022-04-06 11:05:34 starting off with say 20x20 grid chip in MQFP with 96 pins would be groovy 2022-04-06 11:06:21 That would be fun. I was hoping that eventually they could be much much larger - likes millions of cells. 2022-04-06 11:06:57 Like the pixels in our displays. :-) 2022-04-06 11:07:11 Veritable ocean of logic. 2022-04-06 11:07:14 it is the gate propagation speed I am concernef about 2022-04-06 11:07:33 Yes, for sure - that would have to be considered in the design. 2022-04-06 11:07:46 As the thing got bigger it would be more and more impossible to ignore it. 2022-04-06 11:08:02 And if it's combinational, the dynamics that could start to appear would be fascinating. 2022-04-06 11:08:35 I think recognizing that delay would have to be an overt part of your thinking on large grids. 2022-04-06 11:09:03 plus the one I specified above would be useful and manifacturable open source ecology wise 2022-04-06 11:09:28 That would be smashing. The more open source the better. 2022-04-06 11:10:17 so BitGrid blocks and bus routing blocks checkered together would work better I hold forth 2022-04-06 11:11:15 Yeah, I guess you could have all manner of arrangements of that type. 2022-04-06 11:11:40 bus routing blocks are pretty easy to design: per output of the block have a mux that selects between inputs of the block 2022-04-06 11:12:17 Yeah - when you start thinking "on chip" you have to turn off your "high impedance concept" switch. 2022-04-06 11:12:24 two constant inputs (or just one): all zeros, all ones, needs to be in that set 2022-04-06 11:22:02 so the 20x20 chip above can be used in conjunction with other chips such as eeprom such as 24c16 or srams with parallel interface and you can get your own custom mcu like thing 2022-04-06 11:27:06 hmm BitGrid blocks plus routing boxes above: one/few of the 'outputs' of such a box would be the config memory access port of a neighbouring BitGrid block 2022-04-06 11:28:47 which means that you could reconfigure easily and if you do not need that BitGrid block for logic, use it as memory block 2022-04-06 11:32:51 stealing a page out of Harris RTX 2010 design one could get a small Forth computer out of four such BitGrid blocks: one in middle for the logic and three neighbours for the memories 2022-04-06 11:34:17 one for datastack, one for returmstack, and one for wram/pram 2022-04-06 11:34:48 s/turm/turn/ 2022-04-06 12:15:00 Ok, I purged that "count byte MSB set" from the system. So now the name strings are first class Forth counted strings instead of "hacked" counted strings. 2022-04-06 12:15:20 What motivtaed this yesterday was that I did some timing comparisons between my system and GForth. 2022-04-06 12:16:05 On the execution of compiled code, I did quite well - I first created a loop that was as close as possible, given my system, to a GForth loop I timed. I was a little slower, but only a few percent. 2022-04-06 12:16:34 On top of that, my "added words" (conditional return) let me re-write that same loop in a different way, and that ran 15% faster than the GForth loop. 2022-04-06 12:16:37 So, good. 2022-04-06 12:17:04 But then I used the >in reset trick to time loops over interpreted actions (dictionary search and number conversion, primarily). 2022-04-06 12:17:10 And GForth just kicked my ass. 2022-04-06 12:17:30 I strongly suspect that they've got some good native code support somewhere down in FIND. 2022-04-06 12:18:09 So, I'm interested in replacing that deepest loop, the one that compares the strings, with some suitable primitive support, and a primitive that compares counted strings and leaves a flag looks like the right way to go about that. 2022-04-06 12:18:16 Then I'll compare again and see where we are. 2022-04-06 12:18:47 Their FIND has at least a few top levels that are Forth, because I can SEE them. 2022-04-06 12:18:58 But it's that deepest loop that has the most impact anyway. 2022-04-06 12:20:31 That high MSB bit in the dictionary names was complicating the application of a "general compare word" to the task. But... gone now. 2022-04-06 13:00:03 KipIngram: that sounds nice 2022-04-06 13:01:09 and iirc, IBM 370 has an block compare instruction which I found strange 2022-04-06 13:02:26 though myself would just implement that function as a routine 2022-04-06 13:03:44 basically count down loop whose body is to fetch the two machine-words, xor them together and or that result into an accumulator register 2022-04-06 13:18:42 It's better - every since one of us mentioned that a dictionary would be better if the name came at the end of the record, I've pouted a little over mine not being that way - it's clearly a right idea. I refined it a little by putting the PFA first, with the CFA being second and the "anchor" of the record. Because primitives don't need a PFA field - it's "optional." What really got me off the dime, though, 2022-04-06 13:18:45 was the notion of being able to use a fast string compare primitive. 2022-04-06 13:19:11 At the moment I'm re-working my FIND so that it invokes an explicit string compare operation, which I'll initially write in Forth but will be able to replace with such a primitive. 2022-04-06 14:49:08 Zarutian_HTC: I think the modern-x86 viewpoint is that you want a hw insn for {mem,str}{cpy,cmp,move}, because they're often performance-sensitive and the cycle-optimal implementation can be heavily uarch-dependent 2022-04-06 15:32:28 remexre: well legacy x86 is pretty consistant with other CISCs 2022-04-06 16:13:16 ... in that regard 2022-04-06 16:14:05 sorry got distracted, then I had to make dinner and I just noticed now the missing bit 2022-04-06 19:43:15 This is fun: 2022-04-06 19:43:17 https://www.youtube.com/watch?v=FyCYva9DhsI 2022-04-06 19:43:30 And scarily evocative of the real world. 2022-04-06 20:51:30 Wow - I watched that whole thing. Very entertaining. 2022-04-06 22:31:38 I suppose GForth uses hashing for its dictionary search. 2022-04-06 22:31:58 What I'm measuring seems too fast to be anything else. 2022-04-06 22:39:18 Yeah - I think I've proven pretty conclusively they're hashing. 2022-04-06 22:39:44 I expect they build it up as they're gathering bytes from the input stream, so it's ready to go when they get to the space. 2022-04-06 22:39:52 It's what I'd do. 2022-04-06 22:55:17 Anyway, I defined the tib-loop word using a 45-character name and measured it. That came out around 260 NANOSECONDS per iteration. An iteration involves parsing the word from the input buffer, finding it in the dictionary, and executing it. 2022-04-06 22:55:50 Then I defined five more 45-character long names, each of which differed from the first in just one character somewhere in the string. So, no "count by discrimination." 2022-04-06 22:56:14 I measured that again. The time per iteration hardly budged. 2022-04-06 22:56:56 i fibbed though - I'm sorry. The 260 ns was for the name "tib-loop." The 45-char name took it up to 350 ns. 2022-04-06 22:57:19 But still. The point is that the need to "search past" five equal length, near match names didn't slow it down AT ALL. 2022-04-06 22:57:23 so - it's not doing that. 2022-04-06 22:57:28 It's hashing. 2022-04-06 22:59:52 Anyway, mine takes about 10.4 microsecond to parse, find, and execute "tib-loop," and it only goes up to 11.5 us for a 45 char name. (I've installed a string match primitive now). 2022-04-06 23:00:20 I haven't tried the 5 extra names on mine yet - I don't have command history so I'd have to type them all out by hand - ugh. 2022-04-06 23:00:31 Guess I could paste. 2022-04-06 23:01:20 Anyway, as far as I can tell the new primitive leaves me with my actual string matching time being a fairly small fraction of my overall effort, which was the point, of course. 2022-04-06 23:10:00 Anyone know how to "more" the GForth word list? when I type 'words' it just scrolls right off the top of the page. 2022-04-06 23:10:07 I can't see the first words it outputs. 2022-04-06 23:35:58 Unless there's a mechanism for paging it, I question the utility of having such a word. 2022-04-06 23:38:33 Oh - ok. 2022-04-06 23:38:53 gforth --evaluate "words bye" >output