#milkymist IRC log for Sunday, 2012-02-12

Fallenouyep I added 3 new csr to gnu as00:04
dvdkFallenou: found that out already :)00:08
dvdkFallenou: why didn't you just use hexcodes in asm("")?00:08
Fallenouhehe you are finding too fast :)00:08
Fallenouwhere ?00:08
dvdkwell, there is no need to patch binutils, afaics00:09
Fallenouwell I could just generate ram.data files directly entering binary00:09
Fallenoubut I prefer compiling C or assembling asm00:09
FallenouI actually didn't know I could directly put opcodes in hex in asm()00:10
Fallenoubut it's really more convenient to write instructions rather than opcodes in hex :)00:10
dvdkwell making it work it's more difficult than i first thought.00:13
Fallenouoh I just noticed I havn't pushed the code I'm using to do my tests00:13
dvdkyou need a fixed register to use so you could do something like "mv r1,%0; .word 0x..hexcode.." and tell GCC via clobber list that "r1" is clobbered.00:14
Fallenouoh ok I did it on a different branch "mmu-bios"00:14
dvdkBTW i've just added CSR read/write support to the lm32 gforth image i built00:14
Fallenoumodifying gnu as allows me to do this kind of thing : https://github.com/fallen/milkymist-mmu/blob/mmu-bios/software/mmu-bios/crt0.S00:14
dvdkin case you want to test CSRs without having to load firmware over and over00:15
Fallenouoh nice job :) thanks !00:15
Fallenou(line 133 for the link I posted)00:15
Fallenougotta go running out of battery !00:16
Action: dvdk would have just used a macro that spits out .word 0x...00:16
Fallenougn8 ! see you tomorrow00:16
dvdknight00:16
dvdkout of battery: me too :)00:16
wpwrak_dvdk: (csrs) you can access them from the FN console00:26
wpwrak_dvdk: mdump, medit, etc.00:26
wpwrak_dvdk: of course, having that in your forth system is nice, too :)00:27
dvdkmpwrak_: that'd be a little bit too high-level?00:27
wpwrak_why high-level ? it's just register read/writes00:27
dvdki mean, it's from within RTEMS, with lots of code running concurrently, IRQs enabled etc.  Might not be a good idea to mess with the MMU in such an environment00:28
wpwrak_ah, i see. yes, for mmu experiments, you probably want to start simple00:29
dvdki mean, in forth I can do stuff like  1234 EBA! and it still runs.  try to write EBA from RTEMS :)00:29
wpwrak_so you're planning to use forth to (de)bug the mmu ?00:29
wpwrak_i don't even know what EBA is ;-)00:29
dvdk"exception base address", i.e. start of vector table :)00:29
wpwrak_ah yes. i can see how this might lead to tragedy :)00:30
dvdkyeah, let's see whether i can help with the mmu stuff.  can't wait to get linux running on the mm100:30
dvdki mean, a real linux00:30
wpwrak_you're not alone there :)00:30
Action: dvdk just forgot something important when disturbed by Mr wpwrak_underscore00:31
dvdkhmm, what was it?00:31
wpwrak_oh, didn't notice i got underscored00:32
dvdkBTW the LM32 cpu nicely survives reading non-existing CSRs.  thought that woudl lead to an illegal instruction irq or sth00:33
wpwrakmost devices probably don't even decode all the address bits00:34
wpwrakand since read don't have a side-effects, nothing bad can happen00:35
dvdkwpwrak: hmm, with the mdump references above, maybe we're misunderstanding as to what a CSR is?  I mean three-letter-acronym collisions etc.?00:36
wpwrakthinking of it ... i wonder if one couldn't make them have side-effect, though :)00:36
dvdki'm talking about the intra-cpu registers, no MMRs00:36
dvdkbut you're right intra-cpu there should be some kind of address decoder, too00:36
wpwrakScopeuk: hmm, you mentioned that you have a trigger-finger. do these pads send control messages ? or notes ?01:02
wolfspraulwpwrak: if we are going into R4 layout, should we make it a nice-to-have item to move/rearrange the microsd slot a little so that ubb would fit?01:26
wolfspraulI think ubb only extends a few mm, so maybe not much space is needed...01:26
wpwrakhmm. lemme have a look01:36
wpwrakdon't bother ;-)01:38
wpwrakin this connector, UBB is upside-down. almost nothing could be done with it in this configuration01:39
wolfspraultoo crowded?01:39
wolfspraulah ok01:39
wolfspraulyes that's true01:39
wolfspraulon the bottom of ubb, is that conductive?01:39
wolfsprauljust looking at it too..01:39
wolfspraullooks like a gnd plane, and I see a via going to the bottom side, I think01:40
wpwrakyes, correct01:40
wolfspraulso the entire bottom side of ubb is conductive?01:40
wpwrakyes01:40
wolfspraulok01:40
wolfspraulalright, got it. idea doesn't work :-)01:41
wpwrakyou could make a reverse ubb that has vias for everything, but ...01:41
wolfspraullayout can focus on our other 25 objectives :-)01:41
wolfspraulno no, I just try to make the most of our R4 layout work01:41
wpwrakyeah. they're not going to run out of work :)01:41
wpwrakmolex don't even specify the vertical clearance of the card above the PCB. i've measured 0.9 mm, which looks about right. maybe you can fit a ribbon cable. but i wouldn't bet on it01:45
wpwrakto make something useful for ubb, the connector should be at the board edge. and preferably on the bottom, like in the ben01:46
wpwrakbut since we already have these nice expansion headers ...01:46
wolfspraulsure01:46
wolfspraulit was an idea, which doesn't make sense now - done01:47
wolfspraul:-)01:47
wolfspraulsomething along the lines of "can an expansion board power the m1?" :-)01:47
wpwrakyuck :)01:47
wolfspraulah speaking about power, can dvi-i power an attached monitor?01:47
wolfspraullemme see..01:47
wpwrakat long as it draws no more than 50 mA ...01:47
wpwrakthat's what it is allowed to draw from the +5 V supply on the DVI connector01:48
wolfspraulpin 14 = 5V power for monitor when in standby ?01:48
wpwrakyes, that kind of thing01:49
wolfspraulseems the idea is to only power standby mode?01:49
wpwrakhmm, where's adam's nice document when you need it ...01:49
wpwrakhttp://www.ddwg.org/lib/dvi_10.pdf01:51
wpwraksection 2.2.6, page 1501:51
wpwrak2.2.6.2 even01:52
wpwrak50 mA in standby, 10 mA otherwise01:52
wolfspraulhmm, read it02:03
wolfspraulbut what's the bigger point? I don't understand right now02:03
wolfspraulthe idea is definitely not that the monitor powers itself from that 5V source02:03
wolfspraulso the monitor is supposed to have a second independent power source?02:03
wolfspraulbut what if some magic new monitor only needs 50 mA total?02:03
wolfspraulwhy should the monitor, under the spec, draw less when powered on than in standby?02:04
wolfspraulwhat if it draws 50 mA all the time (except for being 'out of the spec' then)?02:04
wpwrakdunno :)02:06
wpwraki suppose it will get no pudding, for being a bad monitor02:08
wolfspraulthere must have been some thinking behind this02:08
wolfspraulwhy less in 'normal' op than standby? makes no sense02:09
wolfspraulyou think a notebook will turn off a monitor that nastily draws 50 mA all the time?02:09
wolfspraulthat would need extra circuitry to enforce this rule, since it must be able to supply 50mA in standby already - no?02:09
wolfsprauland I guess the underlying assumption here is that no monitor will ever be able to operate in normal 'on' with only 50mA02:10
wpwrakmaybe the idea is to limit the overall power budget on the signal source. if the monitor is off, it doesn't need to generate a signal, so it consumes less power and can give more to the monitor02:12
wpwrakbut i'd have to work on my telepathic skills to be certain02:13
wpwrakand yes, they don't seem to be ready for your 50 mA monitor :)02:13
wolfspraulnot needing power for not generating a signal seems very far fetched02:14
wolfspraulsince the system may very well be running full power still, even though the monitor is disconnected or in standby02:14
wolfspraulbut we are all just guessing, I got the facts already...02:14
wolfspraulso the spec says we must be able to provide 50mA over pin 14, and R4 will do that?02:14
wolfsprauland I assume R4 can provide that all the time, and will not enforce the "10mA during normal on" rule?02:15
wpwrakif you want power, you could always use displayport. there, you have 500 mA at 3.3V, according to wikipedia02:15
wolfspraulsure I can imagine that they are moving to integrating power02:16
wolfspraulbut we do dvi-i now :-)02:16
wolfspraulI just try to understand02:16
wpwrakthe R4 situation is still unclear02:16
wolfspraulso our design can provide 50mA on pin 14?02:16
wpwrakwith just a resistor, not 50 mA at any sensible voltage02:16
wpwrak(a 47 Ohm resistor)02:16
wpwrakadam is looking for current-limiting circuits02:18
wolfspraulah ok02:18
wolfsprauldidn't know/follow that that was the issue currently being worked on02:18
wolfspraulI just had the "how about power on dvi-i" popping up in my dreams :-)02:18
wpwraki've described a BJT-based current limiter: http://downloads.qi-hardware.com/people/werner/m1/tmp/r142.pdf02:19
wpwrakthat should work in real life as well. but it can burn quite a bit of power in the transistor if shorted02:19
wolfspraulis the led circuit settled now btw?02:19
wolfspraulI read some things about choosing the right caps/resistors and how bright the leds could still be...02:20
wpwrakfrom my side it is. dunno if adam will have more questions02:20
wolfspraulas long as software is in control, I don't mind more brightness :-)02:20
wolfspraulI guess we all do...02:20
wpwrakM1r4 will make a nice flashlight ;-)02:21
wpwrakwolfspraul: (lattice) so communication has been established, at long last :)02:55
wolfspraulyes, a first small string02:58
wpwraktold you you don't have to give up so quickly :)03:15
GitHub102[flickernoise] wpwrak pushed 6 new commits to direct-midi: http://git.io/kDrT9Q05:44
GitHub102[flickernoise/direct-midi] compiler/doc: icons for MIDI controls - Werner Almesberger05:44
GitHub102[flickernoise/direct-midi] stimuli: raise threshold for range -> button from 1 to 64 - Werner Almesberger05:44
GitHub102[flickernoise/direct-midi] stimuli: treat toggle -> button like toggle -> range - Werner Almesberger05:44
xiangfuwolfspraul, Hi09:16
Fallenoumorning09:57
kristianpaulmorning12:03
kristianpaulshame.. when seting loop2 = 4 not just only par did kept running for 600minutos12:15
kristianpaulfor saying that ~15000 were not routed and timing was not met..12:16
kristianpauls/ loop2 = 4/ loop2 = 212:17
Action: kristianpaul trying loop2 = 4 now12:17
wpwrakah, another day. now, what shall we do with it ? fix the economy ? hmm, maybe later. bring world peace ? boring. eliminate world hunger ? yes, this sounds like a worthwhile plan. first step, breakfast ...12:20
xiangfuwpwrak, Hi. I have a question about DX212:33
xiangfuwpwrak,  I have a USB--> MIDI converter. it have two MIDI port. TX and RX.12:34
xiangfuI connect the DX2(midi out) to USB->MIDI(RX port).12:34
wpwrakyes ...12:36
xiangfuwhat ever I press the button or turn the encoder. the USB->MIDI get nothing. (there is a LED light on the converter) what ever I do, the LED stay off. never flicker12:37
xiangfuis this DX2 broken?12:37
wpwrakdoes the LED normally flicker when there's traffic ?12:38
wpwrakand what does the usb-midi connect to, a pc ? or m1 ?12:38
xiangfuusb-midi connect to a pc.12:40
xiangfuI can sure the usb-midi converter works fine. (test with M1 and LV3)12:41
xiangfufrom http://faderfox.de/DX2_User_manual_V02.PDF12:41
xiangfuYou can activate the controller’s system mode if you press both of the two black Load-keys.12:42
xiangfuThe yellow Sys-Mon-LED next to shift is on to signal this mode.12:42
xiangfuNo midi signals are sent as long as the controller is in this mode. Only the incoming commands via midi-in slot are sent directly to the midi-out.12:42
xiangfu---12:42
xiangfuI activate 'the controller's system mode'12:42
xiangfualso there is nothing output from midi-out12:42
xiangfu(I send midi message to DX2's midi-in by using LV3)12:43
wpwrakthe DX2 has proper power ?12:44
xiangfuyes.12:44
xiangfuI tested with build-in battery.12:45
xiangfuand tested with a 5V power .12:45
wpwrakand if you exit "system mode", is it still silent ?12:45
xiangfu(the milkymist power adapter)12:45
xiangfustill silent12:46
wpwrakmaybe try changing FX1/FX212:49
xiangfuhow to do that.12:50
wpwrakpress the button :)12:50
wpwrakmaybe you have to do it in system mode, then exit back to normal mode12:51
wpwrakwhat are you using to monitor it ? midi2osc ?12:51
wpwrakbecause, if you get note events, midi2osc wouldn't print them12:53
wpwrakand it seems that note events are most of what that controller sends12:53
xiangfuyes midi2osc and the LED on the converter :)12:53
wpwrakmaybe add a printf on SND_SEQ_EVENT_NOTEON12:54
xiangfunothing output. :(12:58
wpwrakhmm. and you did connect it with qjackctl after restarting midi2osc ?12:58
xiangfuyes12:59
wpwrakand on the M1 it doesn't work either ?12:59
wpwrakconnected via MIDI12:59
xiangfuconnect the DX2 to M1 through MIDI cable. donesn't work either :(13:04
xiangfu~~~To choose between two possible setups you have to use the two middle green keys of the FX-13:06
xiangfusection and press the shift-key in the system mode:13:06
xiangfu-FX1-LED = setup 1 (CC/note-data is sent on channel 16)13:06
xiangfu-FX2-LED = setup 2 (CC/note-data is sent on channel 1)13:06
xiangfuwpwrak, I also tried this.13:06
xiangfusame result. nothing from midi-out :(13:06
wpwrakhm, then i'm running out of ideas :-(13:07
xiangfuok. then it's broken :)13:16
kristianpaulgood loop2 = 4 get ok.. lets try 3 and cross fingers..13:18
wpwrakxiangfu: maybe stop midi2osc and qjackctl and run rosegarden. that also has a nice MIDI monitor. maybe it can see something13:20
xiangfuwpwrak, download and installing..13:24
xiangfuI guess it will not help. since the hardware indicate LED never flicker. :(13:25
wpwrakmaybe try it first with a known to be good midi device13:26
wpwrakyeah, that's suspicious13:26
wpwraki think it's safe to try plugging things in a different order. so maybe try the other port on the DX2. or if this doesn't help, the other connector on the USB-MIDI dongle13:27
wpwrakyou have a total of four combinations :)13:27
xiangfu:) ok. doing that now.13:29
GitHub130[flickernoise] xiangfu pushed 1 new commit to master: http://git.io/cTem3g13:30
GitHub130[flickernoise/master] Makefile flash: remove useless parenthesis, only reflash regular partition - Xiangfu Liu13:30
xiangfuwpwrak, no luck. :(13:32
xiangfuand I also tried this with 'mixxx'13:33
xiangfuunder 'MIDI controllers' . there is a MIDI Learning Wizard.13:33
xiangfuno message when I press buttons under DX2.13:34
wpwrakhmm, doesn't look good then13:34
xiangfuok. mark as broken. :)13:40
wpwrakproblem solved :)13:44
xiangfuwpwrak, another thing is the my ICON usb midi controller also not working under latest flickernoise(mater branch)13:44
wpwrakdoes uSB work at all ? i noticed that i sometimes get a completely dead usb. a reboot or two usually solve this.13:46
xiangfuusb keyboard and mouse works.13:48
xiangfuthis ICON using most channel 0.13:48
xiangfuis the LV3 still works on your side?13:48
xiangfuboth ICON and LV3 not working under latest 'mater' branch. (latest milkymist and flickernoise repo)13:49
wpwrakyes, LV3 works here13:50
xiangfuwpwrak, I think I got quiet some not working device now. :)13:50
wpwrakbut it sometime needs a few reboots13:50
xiangfuhmm..13:50
xiangfubut I even can't get midi message from MIDI port on m1.13:51
xiangfuwpwrak, more infor about ICON: http://en.qi-hardware.com/wiki/Milkymist_One_accessories#MIDI13:52
wpwrakyes, that looks right13:53
xiangfunow. when I setup the 'vmpk', m1 'MIDI settings' 'Latest active controller' get nothing :(13:55
GitHub132[flickernoise] wpwrak pushed 5 new commits to direct-midi: http://git.io/iGEOgg15:08
GitHub132[flickernoise/direct-midi] stimuli, compiler: renamed "toggle" to "switch" - Werner Almesberger15:08
GitHub132[flickernoise/direct-midi] compiler/doc: renamed "toggle" to "switch" - Werner Almesberger15:08
GitHub132[flickernoise/direct-midi] compiler/doc: changed "MIDIC" to "MIDICC" to match MIDI terminology - Werner Almesberger15:08
qi-botThe Firmware build was successfull, see images here: http://fidelio.qi-hardware.com/~xiangfu/build-milkymist/milkymist-firmware-20120212-1439/15:26
kristianpauldamn timing failure..  http://paste.debian.net/156010/18:11
FallenouI don't get it, my asm volatile (); in main.c bios does not end up in bios.elf18:56
FallenouI can't see it if I do lm32-rtems4.11-objdump -D bios.elf18:56
FallenouI put something like this :18:57
Fallenouhttp://pastebin.com/WNWb8vCE18:58
wpwrakgcc -S will tell you if it makes it to the assembler output19:08
Fallenouit does not end up in main.S19:12
Fallenoumain.s19:12
wpwrakvery suspicious19:12
FallenouI would expect gcc to give me at least a warning before deleting my asm volatile poeme :'19:12
wpwrakit's not really supposed to ...19:13
wpwrakwell, try adding a memory clobber. shouldn't make a difference, though19:13
whitequarktry __asm__ __volatile__19:13
whitequarkiirc it means "this is REALLY volatile."19:13
Fallenouit was working "before" with asm volatile()19:13
Fallenoubut I was not using any register19:13
Fallenounow I use one (r11)19:13
Fallenouand I added it to the clobber list19:14
abushcrafterforgVJs: Any opinions,notes,thoughts,hints on the state of gnu/linux sound to light dmx control software? for this newbie who is just started reading about it19:14
Fallenoulet's try __volatile__ and "memory"19:14
wpwrakwhitequark: afaik, __xxx__ just means xxx but without namespace pollution19:14
wpwrakFallenou: there isn't something like an  if (0)  before it by any chance ? ;-)19:15
Fallenouadding "__" didn't help19:15
Fallenouaddind , "memory" didn't help either19:15
Fallenouwpwrak: hehe no :p19:15
FallenouI will paste all the code19:15
wpwrak(memory) yeah, the "volatile" should go the trick19:15
wpwraks/go/do/19:16
Fallenouhttp://pastebin.com/KcRGmaAw19:16
Fallenoucode is ugly sorry about that19:17
FallenouI tried several things19:17
Fallenounone worked :)19:17
wpwrakmore things to check: 1) put a syntax error to see if this is really the file you're compiling. 2) lower the optimization level.19:17
Fallenouok19:18
wpwrakare you calling dtlbtest ?19:18
Fallenouyes19:18
Fallenouand right before modifying the asm code I uploaded the bios to the M1 and the function run19:18
FallenouI could see the two puts()19:18
wpwrakchange the content of the puts to confirm that what runs really comes from the same source19:19
Fallenoua C error makes compilation fail19:19
wpwrakhmm. optimization levels next ;-)19:20
wpwrakand you may want to be careful with your macros. extra parentheses may avoid surprises19:21
Fallenouoh wait ...19:21
wpwrak;-)19:22
FallenouI was searching for "tlb" or "dtlb" in the objdump output19:22
Fallenoubut it's upper case ....19:22
wpwrakheh :)19:22
Fallenouok sorry :)19:22
Fallenouthanks !19:22
wpwrakbut why wasn't it in the asm output ?19:22
Fallenouit was there I think19:22
wpwrakof did you mis-search there, too ?19:22
FallenouI just didn't see it19:22
wpwrakah :)19:23
Fallenouyep ok it's in bios.elf as well, good19:23
Action: Fallenou was getting crazy19:23
Fallenouin a few minutes it's time to either open champaign or put a gun in my mouth19:24
wpwrakmake it champagne vs. hard liquor. one to celebrate, the other to wash away the frustration :)19:24
whitequarkalias grep='grep -i'19:25
Fallenouwhitequark: yep :)19:26
Fallenouwpwrak: good point :p19:26
Fallenouok I enter dtlbtest and it spits out : "Star"19:26
Fallenouhu mhu m!19:26
Fallenouok removing the "*addr = 0x42;" makes the test print FAILURE instead of crashing the M119:29
Fallenouwhich proves at least something is going on when mmu is enabled :p19:29
Fallenouon/wrong ? :p19:29
whitequarkheh19:30
wpwrakwrONg :)19:30
Fallenou;)19:31
Fallenouok let's eat a little bit and then back to make this work20:01
Fallenouok it does not even boot this time21:21
Fallenoudamn it21:21
FallenouHi dvdk21:38
dvdkhi21:40
lekernelFallenou: I think you should validate things first in simulation before trying to run on FPGA21:40
dvdkjust trying to compile/synth your -mmu branch21:40
dvdk(that is: just started to /try/ to compile it)21:40
lekernelfirst there are lots of things that can go wrong, so it's important to be able to observe/process internal signals21:40
lekernelsecond the synthesis tools are slow21:40
kristianpaulargh, come on fpga4fun ant is rtl uart core is non-free :-|21:40
dvdkso can we actually run code in the simulated lm32 core?21:41
lekernelyes, of course21:41
dvdki.e. is it fast enough?21:41
dvdki mean, simulated as in verilog-simulattion21:41
kristianpauls/ant/and21:41
lekernelyes, but the test should be only a few dozen instructions at most anyway21:41
dvdkok, I'd guess it could even run gforth, well let's try that later.21:41
dvdkFallenou: mind if i patch your code (bios etc.) to run with standard binutils?21:42
Fallenoulekernel: so far I have been doing simulations a lot21:42
Fallenouit seemed to be working pretty well21:42
Fallenouso I started on the FPGA21:42
lekernelwell, if you feel like doing a sim environment with bidirectional uart etc21:42
Fallenoudvdk: it's not working yet you are losing your time if you are trying to synthetise it21:43
Fallenoudvdk: but you can look at the simulation project, it is starting to have promising behaviours :)21:43
dvdkFallenou: I figured that.  just trying to find a spot to start with21:43
dvdk(simulation) where?21:43
Fallenouhttps://github.com/fallen/milkymist-mmu-simulation21:45
Fallenouthis21:45
dvdkalready had it via google :)21:45
Fallenouatm I am working on this, it allows me to see what's going on inside the lm32 cpu21:45
dvdkok, you branched off the full lm32 designs21:45
Fallenouto look at wave forms of wires and regs21:45
FallenouI just put the lm32 cpu and sram21:45
dvdkwhat sw are you using for simulation?21:45
Fallenouusing migen to generate interconnect arbiter etc21:46
Fallenoudvdk: I tried to document it, there is a README file21:46
FallenouI am using a modified stripped down "bios"21:46
dvdkno bios sourcecode ther?21:47
Fallenouhttps://github.com/fallen/milkymist-mmu/tree/mmu-bios/software/mmu-bios21:47
Fallenouthe ram.data and bios.bin are provided in the "simulation" project21:47
Fallenoubut if you want to generate your own end modify it etc you can read README.advanced21:47
dvdki only have ise 13.3 installed here.  i guess that's sufficient?21:48
Fallenouyes sure21:48
dvdka Makefile21:48
dvdk!21:48
Action: dvdk loves makefiles21:48
Fallenou:)21:48
Action: dvdk hates the ISE toolchain 21:48
Fallenouif you have ISE installed you can run the simulation within seconds just by reading the README21:49
Action: kristianpaul follows dvdk 21:49
Fallenouwhich will tell you to source a file and do make :)21:49
dvdkthe ram.data is just for testing, i.e. whatever is in there is ok?21:49
Action: dvdk already skimmed the readme21:50
dvdkok, i can see the isim gui.21:51
Fallenoubasically for now I'm just testing the DTLB21:52
FallenouI didn't modify the instruction stage21:52
Fallenouone step at a time21:52
Fallenouthe bios just set r0 to 0, set EBA, and jumps to _crt0 which contains a few tests21:52
Fallenoua few memory loads to test that the cpu is working21:53
Fallenouwhich was not the case when I started simulating :)21:53
Fallenouand then I add an entry in the DTLB21:53
Fallenouand I test if it works21:53
Fallenouand by looking at D_ADR_O / load_data / load_q_m store_q_m etc in the wave window21:54
dvdkjust looked at soc.v21:54
Fallenouyou can check if it works or not21:54
dvdkquite a huge testbench21:54
Fallenousoc.v was generated by migen :)21:54
FallenouI stripped it down a little bit that's all21:54
Fallenouthere was uart and flash at first, I removed it21:54
whitequarkfolks. tomorrow my m1 arrives21:55
whitequarkwhat's the work which needs to be done?21:55
whitequark... actually it's "today" already at UTC+421:55
Fallenou22:46 < dvdk> Fallenou: mind if i patch your code (bios etc.) to run with standard binutils? < you really prefer having unreadable ".word 0xaabbccdd" in the code ?21:55
Fallenouinstead of readable instructions ?21:55
dvdkFallenou: you could define a gnu as macro to handle that.21:55
Fallenouoh ok21:55
Fallenoudvdk: well ok it would allow someone so generate code without the head ache of recompiling gnu as :)21:56
dvdkFallenou: that was my motivation.  Lower the barrier for people to start hacking21:56
Fallenoueventually it will be needed, I think, but for now it's cool if we can lower the entry barrier21:56
Fallenouok awesome !21:56
FallenouI would appreciate and commit it21:57
dvdkok, starting on it.  the soc.v still gives me headaches, need something easy to begin with :)21:57
FallenouI barely read it :p21:57
Fallenoubut I am starting to know by heart lm32_dcache.v huhu21:58
dvdkisn't there an easier way to debug the model than to look at the isim plots?  like adding a lot of debug output and just reading logs instead?21:58
kristianpaulprintf21:59
dvdkwould also allow to add more automatic test-cases.21:59
dvdkto look for regressions etc.21:59
Fallenoudvdk: yes lekernel suggested that as well21:59
FallenouI am deeply convinced that I could not understand lm32 internal stuff with just adding $display() around21:59
Fallenoubut by looking at wires22:00
dvdkFallenou: yeah, that's the problem with fully concurernt hdl designs.22:00
kristianpaulor understading blocks by blocks22:00
kristianpaul?22:00
Fallenoubut maybe now that I'm more familiar with the internal behaviour I could maybe add display22:00
Fallenouto lose less time22:00
Fallenoubecause yes it's really painfull to read all those wires22:00
dvdkwhat about a gforth debug console into the running simulation? :)22:00
Fallenouoh by the way22:01
FallenouI wanted to ask you about gforth22:01
FallenouI am kind of ignorent about this language22:01
dvdkFallenou: yeah, it's like a dead language.22:01
dvdkanyways.22:01
Fallenouyou were saying it could help having a console to debug the mmu22:02
Fallenoubut, gforth interpreter is code that runs on the lm32 cpu, right ?22:02
dvdkbut it's low-level and very compact intereter core.  can read/write raw memory, define test-cases etc. just from the interpreter console22:02
dvdkyes.22:02
dvdk(running on the cpu)22:02
Fallenouyep22:02
FallenouI think it's safer and maybe easier to just make little bios.bin files22:02
Fallenouto test mmu22:02
Fallenoubecause you really control what runs on the cpu22:02
dvdkwell, wrt to the gforth interpreter core, that's written in assembly (mostly by myself), so I do control what runs.  But you're right let's keep it simple.22:03
Fallenouyou write a few assembly lines, you know what you expect from them, and you can simulate it or run it if you're confident on the fpga22:03
Fallenouok yes you seem to control what you do, sure :)22:03
Fallenoubut I think I wouldn't :p22:04
dvdkok, going to look at the csr stuff22:04
kristianpauldvdk: your plans with gforth port is just a debug platform for m1?22:05
kristianpaulpehaps an alternative and simple bootloader too?22:05
Fallenoudvdk: nice ! thank you !22:05
FallenouI think it could be nice to debug things too, but here with the mmu it's really a touchy thing22:06
kristianpaultouchy ;)22:06
Fallenoueven C can screw you :)22:07
Fallenouvar = value; in C generate a memory load for example, even if var is declared as register22:07
Fallenoubecause value is not "in the opcode", it's stored in a memory section and loaded22:07
Fallenouso if you are not carefull you do a memory load, and maybe it was unsafe to do it there :)22:08
Action: Fallenou doing another synthesis22:09
Action: kristianpaul reads about uart22:11
Fallenouhum weird22:28
FallenouI have flterm running22:28
Fallenouif I plug the M1 I can see the uart tx led blinking22:29
Fallenouindicating bios is running22:29
Fallenoubut I don't see anything in flterm22:29
wpwrakmany things to try :) restart flterm. check if you have more than one ttyUSBn. check dmesg.22:31
wpwrakalso, does flterm work with the regular system ?22:31
Fallenoujust one ttyUSB022:31
Fallenounothing weird in dmesg22:32
Fallenoujust one flterm22:32
FallenouI did a few make load-bitstream with a custom bitstream22:32
wpwrakfuser -v /dev/ttyUSB0  (as root)22:32
kristianpaulah i had see/sufer than before (flterm gone..)22:32
Fallenoubut I think unplugging power should restore the bitstream22:32
kristianpaulj just re-load usbserial and ftdi kernel modules to get it work again22:32
Fallenouwpwrak: shows nothing22:33
wpwraknot sure how you're loading your bitsteam. i always flash mine.22:33
FallenouOK kristianpaul thank you22:34
Fallenouthat was it22:34
Fallenourmmod ftdi_sio and usbserial22:34
Fallenouand unplug / plug usb cable22:34
Fallenouwpwrak: I load it using make load-bitstream from top src dir22:34
Fallenouit just sends it to fpga from jtag22:34
Fallenoudoes not put it in flash22:34
Fallenouputs(); in bios is asynchronous ?22:36
Fallenouwhen I run dtlbtest from bios it just spits out "Star" and then crash M122:36
Fallenouit should at least print two messages entirely before crashing22:36
Fallenouwait, is it OK to write to flash with just *addr = value; from bios ?22:37
FallenouI guess it's locked and I must erase it first etc22:38
FallenouI should test with ram instead of flash :)22:38
Fallenoufor memory stores22:38
wpwrakthe write protocol for flash is a little tricky22:40
wpwraknot only is it probably locked, but you also have a write enable sequence22:40
wpwrakif you have RAM, then it should be considerably easier to use22:41
FallenouOK, I somehow crazyly thought it was taken care of by some magic hardware block somewhere in the soc :p22:41
Action: Fallenou crazy22:41
Fallenoulet's go for the RAM then22:41
wpwraknaw, you don't want writes to NOR to "automatically" succeed. imagine, one stray pointer ... ;-)22:42
Fallenouarglh :x22:42
Fallenouyep it's better I agree :)22:42
whitequarkwpwrak: is the NOR mmapped?22:47
whitequarker. stupid question.22:48
whitequarkobviously yes.22:48
wpwrakit's mapped, at physical address 022:50
kristianpaulflash.h tell more about the "partitions"22:51
Fallenoudamn it22:52
Fallenouit does not work either with a ram address22:52
Fallenousame "Star" thing22:52
kristianpaultry a hello world22:53
Fallenouand commenting the asm block which does the store word instruction prevent M1 from crashing22:53
Fallenouso it really is this memory store which crashes the M122:53
kristianpaulor not hello world, but not something like bios doing a whole initialization protocol :-)22:53
Fallenoukristianpaul : well the bios works22:53
kristianpaulah22:53
FallenouI have the prompt22:53
FallenouI type "dtlbtest"22:53
Fallenouit runs the dtlbtest() function22:54
Fallenouand then it crashed :)22:54
Fallenoucrashes*22:54
Fallenouthe bios is OK22:54
Fallenouit's just my mmu which is not :p22:54
Fallenouat least it can enter user mode and get back to kernel mode without crashing everything22:55
Fallenouif it does nothing while in user mode :p22:55
Fallenoulet's go back to simultion I guess22:56
dvdkFallenou: here you are:23:06
dvdkhttp://mosquito.dyndns.tv/~spock/mm/0001-Use-GAS-macros-to-assemble-wcsr-rcsr-opcodes-for-non.patch23:06
dvdkwhen disassembled with objdump -D it now shows23:06
dvdkwcsr ???,r123:07
Fallenouhey back23:08
dvdk(or just give me write access then i'll just push it; to lazy too create a github clone for myself)23:09
Fallenouwhat's your login on github ?23:10
dvdkdvdkhlng23:10
dvdkBTW the patch is only for .s files, for GCC inline asm() it'll be a little bit more (ugly) work23:11
Fallenouhere you go :)23:11
Fallenoufor the simulation we only need crt0.S , it's perfect !23:11
Fallenouthank's23:12
dvdkuh, I pulled via https.  how do I switch URL to use ssh protocol?23:12
Fallenouyou can ush via https23:12
Fallenoupush*23:12
Fallenouit will just ask for your github password in the console23:12
Fallenouif you really want to use ssh key + ssh protocole just edit .git/config23:12
dvdkyeah, now it will ask every time i push :)23:13
Action: dvdk is editing the .git/config23:13
Fallenoufor testing on fpga with dtlbtest I'm using massively asm() in main.c23:13
Fallenoubut recent tests showed that MMU is not ready yet for fpga test :)23:14
Fallenouit still needs some love in the simulator23:14
Fallenouseems easy to use (your macro)23:15
dvdkhmm did the git push do it?  can't see the commit on  https://github.com/fallen/milkymist-mmu/commits/mmu23:16
dvdkyet it says "Everything up-to-date" here23:16
Fallenouswitch to the mmu-bios branch23:16
Fallenouon the github web vie23:16
Fallenouw23:17
Fallenouand you will see your commit23:17
dvdkah, now i see it23:17
FallenouI use "mmu" branch for verilog devel and modifying real bios to add a nice dtlbtest23:17
dvdkok.23:17
Fallenouand mmu-bios branch to do the simulation stuff23:18
Fallenouto generate bios.bin and ram.data files23:18
Fallenouwith the software/mmu-bios/ stripped down version23:18
Fallenoucontaining only crt0.S file23:18
dvdkyes makes sense23:18
Fallenouso you pushed in the right place :)23:18
dvdkin dcache.v it says "IMPORTANT: THIS FILE IS AUTO-GENERATED BY THE LATTICEMICO SYSTEM."23:21
dvdkbut you still edit it directlry?23:21
Fallenouyes23:21
Fallenouall of their lm32*.v files are "generated"23:21
FallenouI guess it's their synonym for "copy pasted"23:22
FallenouI don't really know what they mean by "auto-generated"23:22
dvdkif it's as ugly as xilinx coregen, i don't want to hear about it :)23:22
Fallenouit's I guess it's something like coregen23:22
dvdkauto-generation is for people who can't properly factor source-code into libraries23:23
Fallenoubut the truth is lm32 seems to be quite nicely done and there is plenty of conditional stuff ifdef etc23:23
Fallenouand it depends on macros defined (or not) in lm32_include.v23:23
Fallenouwhich IMO should be the only auto generated file23:23
Fallenou00:11 < dvdk> when disassembled with objdump -D it now shows23:25
Fallenou00:11 < dvdk> wcsr ???,r123:25
Fallenoucool !23:25
FallenouNow I know I didn't mofidy binutils for nothing !23:25
FallenouI have a nicer objdump output than you have ;)23:25
dvdkbut: :)23:26
dvdkthe full line was this: " d3 a1 00 00     wcsr ???,r1"23:26
dvdkso we still have the hexcode :)23:26
Fallenouyes yes :p23:26
Action: Fallenou is just kidding23:26
Fallenouok it seems to generate good opcodes23:28
Fallenouat least for the few wcsr I have in crt0.S23:29
Fallenousimulation is still the same23:29
dvdki double checked it with known IM reg opcodes23:29
Fallenoubasically you can see at time 13 680 ns , at the bottom of the wave screen (last line)23:30
Fallenouthe latest wcsr which enables the mmu23:30
Fallenouput it into "user mode"23:30
Fallenouyou see the "kernel_mode" register drops from 1 to 0 which means going from kernel to user23:31
Fallenouthen you go back all the way up to the first line of the wave window23:31
Fallenouyou go forward a little bit when the first line (memadr) shows 0x005c23:32
Action: dvdk is running the simulation23:32
Fallenouand you can see that D_ADR_O has the value 0x1040 which means the mmu correctly swapped the virtual address 0x0040 to the physical address 0x104023:33
Fallenouit corresponds to the crt0.S code line 161 (lw r2, (r0+0x0040))23:34
FallenouI should document all of this23:34
Fallenouit's a cache miss so the cache tells lm32_load_stores.v to refill the cache so it puts the refill_address on data path lines (d_adr_o)23:36
Fallenouthat's why we can see D_ADR_O having the value23:36
Fallenoubecause cache is refilling23:36
Fallenouit's more subtile the next time on line 165 , you have to look at the load_data line to see it has loaded the right value from the cache23:37
dvdkhere kernel_reg is '1' all the time. (at least up to 20us)23:38
Fallenoufor me it drops down to 0 at 13 680 ns23:38
Fallenouhum hum :o23:38
dvdkah, wrong bios.bin?23:39
Fallenoumaybe23:39
dvdksoftware/bios.bin is ok?23:39
Fallenouyou have to git checkout mmu-bios && cd software/mmu-bios && make && cp bios.bin ~/your_simulation_directory/23:39
dvdkok.23:39
Fallenouthen cd ~/simulation_directory && h2a bios.bin > ram.data && make23:40
Fallenouyou can try h2a bios.bin 1050 > ram.data instead23:40
Fallenouto have some padding23:40
Fallenouwhat's the first line of your ram.data ?23:41
dvdkperfect, kernel_mode changes at 1368023:43
Fallenou:)23:43
Fallenounice !23:43
Fallenouour cpu are synchronized23:43
Fallenouwithout ntp23:43
Fallenouthat's nice23:43
dvdkmaybe in the LM32_CSR_TLB_CTRL write-access check,23:52
dvdkit should be case (csr_write_data[5:1]) or sth to reduce synthesis size?23:53
Fallenouoh23:54
dvdk(or use don't cares and casz (verilog has these, no?))23:54
FallenouXst detects it's not used23:54
Fallenouor that there is no load23:54
Fallenouand should not route it23:54
dvdkno, currently it has to check for zero?  because the source register has all the bits23:55
Fallenoubut you're right23:55
Fallenouyes it may not be really elegant23:55
Fallenoulet's only check for meaningful bits23:55
dvdkmaybe don.t care is cleanest.  then Xst can detect and  eliminate23:55
Fallenouyes but it will force us to write 31'bxxxxx something ?23:56
dvdkwith 5 bits 2 compares fit into a single lut :) (afair)23:56
FallenouI vote for 5:1 :)23:56
dvdkyeah.  cleanest23:57
Fallenouactually I'm not in the "let's optimize the hell out of it" phase right now, it does not work yet, but since you spotted it23:57
dvdkjust counting LUTs while reading :)23:57
dvdk(no just kidding)23:57
Fallenouahah :p23:58
Fallenouisn't it 4:1 ?23:58
Fallenoulet's save bits23:59
dvdkbit 5 was for future upgrades (v2) :)23:59
Fallenouhehe :p23:59
Fallenouok let's put 4:1 for now23:59
--- Mon Feb 13 201200:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!