--- Log opened Tue May 17 00:00:10 2016 | ||
SMDwrk | Hi. Can anyone take a look at my patch(http://pastebin.com/TgnYnzTj), give some advices and tell me how can I check if it works correctly with mor1kx? | 06:15 |
---|---|---|
-!- shorne_ is now known as shorne | 06:17 | |
shorne | SMDwrk: I dont know the code base, but the patch looks ok (always good to add comments). What is the theory of operation for this 4 state predictor? | 06:49 |
SMDwrk | shorne: afaik this was used in first mips cpu, https://en.wikipedia.org/wiki/Branch_predictor#Saturating_counter | 06:56 |
SMDwrk | I think it should be better than the existing one | 06:56 |
SMDwrk | and it would be nice if anyone tells me about existing codestyle: tabs vs spaces and amount of them. Maybe I've seen something but unable to find | 07:01 |
SMDwrk | http://pastebin.com/5jMz4AHR - this one's better | 07:15 |
shorne | SMDwrk: tabs/spaces its always best to look at exising code, i.e. your comments on line 32-25 should be aligned | 07:18 |
SMDwrk | shorne: but there's mix of tabs and spaces in existing code and that's confusing. Or is it rather problems of my text editor? | 07:18 |
shorne | let me look | 07:19 |
SMDwrk | Thanks! | 07:20 |
shorne | looks like indentation is aligned 3spaces | 07:25 |
shorne | tab=8 spaces | 07:25 |
shorne | seems no preference to indent with strict tabs or spaces to me | 07:26 |
shorne | to be safe I would use spaces | 07:26 |
SMDwrk | ok, thanks! I'll align everything to 3 spaces | 07:28 |
shorne | SMDwrk: thanks for the link, your change makes sense. 2 thins | 07:32 |
shorne | 1. I would rather use case for the state evaluation, thats more normal for state machines | 07:32 |
shorne | but maybe not so easy? | 07:33 |
shorne | also, I guess the bnf_i and bf_i is no used | 07:35 |
shorne | Have you tested this? | 07:36 |
SMDwrk | >1. I would rather use case for the state evaluation, thats more normal for state machines | 07:39 |
SMDwrk | Ok, I can do that. | 07:39 |
SMDwrk | >Have you tested this? | 07:39 |
SMDwrk | No I haven't, I don't know how, that's why I'm asking here) | 07:39 |
SMDwrk | >also, I guess the bnf_i and bf_i is no used | 07:39 |
SMDwrk | FSM returns result whether or not current inst is cond brn, but it gets updated if previous one was one. So I guess it should be ok | 07:39 |
SMDwrk | I'm not familiar with codebase either, that's why I have so many questions | 07:40 |
stekern | SMDwrk: I can take a look at your patch in the evening, but re coding style, use spaces only. | 07:54 |
stekern | we originally had the mixed tab/space thing, but as you say it's messy so we have moved away from it and all new code should be spaces only | 07:55 |
SMDwrk | stekern: thanks, as it was said above, 3 spaces aligned, right? | 07:55 |
stekern | yes, basically the coding style is "what verilator mode in emacs gives you" | 07:56 |
stekern | sans the mixed tab/spaces | 07:56 |
wallento | If you use emacs there is a one liner for the config to replace tabs with spaces on save | 07:57 |
wallento | for all verilog files | 07:57 |
wallento | https://gist.github.com/wallento/1a3ff7a1809b15b3eb42b45b219897d4 | 07:58 |
stekern | yeah, but please don't do that on existing files ;) | 07:58 |
stekern | massive whitespace patches is a pain | 07:59 |
shorne | olofk: I found how to fix the return value (for cases where its saying misaligned write to 0x6). Need to update logic in or1k_return_value. I am not sure exactly the correct way to do it though | 07:59 |
shorne | option 1. for all return values > 1word return as pointer in 1st arg | 08:00 |
stekern | this is what I have for mor1kx: http://pastie.org/10840712 | 08:00 |
shorne | option 2. for all structs/unions > 1word return as pointer in 1st arg (thats whats implemented now, I added ARRAY's too) but everything I see looks like (option 1) | 08:01 |
SMDwrk | wallento: I haven't got along with emacs yet, so I use geany as text editor | 08:06 |
wallento | well, then you should change the tab behavior of geany | 08:07 |
SMDwrk | wallento: sure. Can you point me to a tutorial on running openrisc so I could run it and test changes somehow? | 08:09 |
shorne | olofk: I have a patch getting most things to work except varargs | 08:17 |
shorne | doing some testing, maybe need one fix, then Ill post | 08:17 |
robtaylor | mdu | 09:08 |
SMDwrk | http://pastebin.com/WxvqfZUS patch with fixed(I hope so) alignement | 09:51 |
shorne | olofk: this is my current page, most is working except the varargs https://gist.github.com/stffrdhrn/ef0a3d95c7460dd24540db7b99b4eee6 | 10:04 |
shorne | these are the test results https://gist.github.com/stffrdhrn/6e19dcbf8cdf04b92552962c790e6bdf | 10:05 |
shorne | I put tons of debug printfs because I dont feel like debugging gdb in gdb | 10:05 |
shorne | interesting tests start from https://gist.github.com/stffrdhrn/6e19dcbf8cdf04b92552962c790e6bdf#file-gdb-gnu-vector-log-L430 | 10:12 |
stolar | what is the difference beetwen or1ksim, OR1K, OR2K, OR32? | 13:15 |
olofk | SMDwrk: The easiest way to run some simulations with mor1kx would be to use FuseSoC | 16:30 |
olofk | Happy to help you get started | 16:30 |
olofk | shorne: I also resorted to printf for the same reason :) | 16:32 |
SMDhome | olofk: are there any tutorials on orpsoc? | 16:47 |
SMDhome | I think ideal scenario for me now would be to run naked mor1kx and to be able to load and execute some binary on it to see if new branch predictor works or not | 16:52 |
SMDhome | running whole soc could be overkill | 16:52 |
olofk | SMDhome: There's a SoC intended for simulation purposes with just a RAM and a UART. It's called mor1kx-generic | 16:55 |
olofk | It also includes the mor1kx monitor, so that you can get instruction traces when running in icarus or modelsim | 16:56 |
olofk | So basically you run fusesoc sim mor1kx-generic --elf-load=/path/to/testfile.elf | 16:56 |
olofk | Or you can run it in verilator with fusesoc sim mor1kx-generic --sim=verilator --elf-load /path/to/testfile.elf | 16:57 |
olofk | But I don't think you get any good traces then | 16:57 |
olofk | 'fusesoc sim mor1kx-generic --help' lists all options | 17:06 |
shorne | olofk: any idea on this one? The args and return pointer seems to be setup correctly. But looks like bug to me. | 18:28 |
shorne | https://gist.github.com/stffrdhrn/ed8b8a9f20a8f7d848631a241c19a113#file-openrisc-vargs-gdb-gnu_vector-asm-L406 | 18:28 |
shorne | The code is returning data from the stack, big no-no in c I thought | 18:28 |
shorne | well, maybe its ok, its not a pointer, it should be copied back to the caller | 18:31 |
shorne | olofk: nevermind, I am in the function (debugging) and breaking before the return and the calcuated values looks bad. The args all look correct though. Maybe something wrong with the assembly, need to go through that | 18:35 |
shorne | Interesting, it looks like we should only send structs by ref if they are larger than a word. | 18:49 |
shorne | trying one update | 18:49 |
shorne | nevermind, that doesnt work | 18:53 |
-!- Dan__ is now known as ZipCPU | 19:49 | |
--- Log closed Wed May 18 00:00:11 2016 |
Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!