<xiangfu> have installed the Xilinx 13.1
<xiangfu> building the bitstream. seems it need some time still building
<xiangfu> kristianpaul: Hi
<xiangfu> from the email we need edit one line to disable the Video out. for fix the sound noise. can someone tell me which file which line I should edit. then I can build the bitstream and test in my MM1.
<xiangfu> I have 0 experiment in VHDL :(
<aw> xiangfu, when i selected 'Webpack' items , it seems will install: Webpack, ISE, ISE DS Common, EDK, Plan Ahead Analysis Tool.
<xiangfu> aw: I just select the 'ISE Design Suite: system edition'
<xiangfu> from the description: " ISE Design Suite: System Edition contains everything you need to do a complete system design."  :)
<xiangfu> '''contains everything'''. I don't know the detail. so just just select all
<aw> finally it asked you for a license?
<aw> xiangfu, 12.3 i installed 'Webpack' only. I remembered it needs a license.
<xiangfu> it's will bring you to xilinx website. then you can got a license file
<aw> xiangfu, yup
<aw> xiangfu, yes, now the installer is asking me for license, so you stopped there? right?
<aw> xiangfu, i think that I am now searching my 12.3 Free ISE Webpack license first. :-)
<xiangfu> aw: no. I have success install. just follow the link. download the xilinx.lic file :)
<aw> xiangfu, 13.1 detects my previous *.lic during last installed 12.3
<aw> seems done successfully.
<lekernel> hi
<wolfspraul> hi
<aw> lekernel, xiangfu hi, i think that we are ready for studying now. :-)
<lekernel> ok, so you have the milkymist source and ise 13 installed?
<lekernel> and sourced ise's settings32.sh?
<aw> not yet..second
<xiangfu> lekernel: I am using a 64bit system? I sourced settings32.sh? is that a problem?
<lekernel> I don't know
<xiangfu> I thought it's for host system.
<lekernel> if it doesn't work try with settings64
<aw> what I need to install for 'source'? i got 'sudo: source: command not found'
<xiangfu> I have no problem with settings64. so I will just using settings64.
<lekernel> aw: why sudo?
<aw> don't know, i usually used 'sudo'..
<lekernel> don't
<lekernel> aw: is it ok? you have commands like impact, xst, ...?
<aw> lekernel, i can run 13.1 impact, 'xst' don't know, never run before.
<lekernel> ok, good
<lekernel> so now go to the milkymist source
<lekernel> and edit boards/milkymist-one/rtl/system.v
<aw> second
<aw> adam@adam-laptop:/opt/Xilinx/13.1/ISE_DS$ source settings32.sh
<aw> /bin/ls: cannot access XIL_SCRIPT_LOC=/opt/Xilinx/13.1/ISE_DS: No such file or directory
<aw> is that ok? i don't know
<lekernel> do you have the impact command?
<lekernel> and xst?
<aw> yes, but i could only run './impact' or '/xst' under adam@adam-laptop:/opt/Xilinx/13.1/ISE_DS/ISE/bin/lin$
<aw> then i have them.
<aw> ./xst
<lekernel> ok, use export PATH=$PATH:/opt/Xilinx/13.1/ISE_DS/ISE/bin/lin
<lekernel> now go to milkymist source boards/milkymist-one/synthesis
<lekernel> and use make -f Makefile.xst
<lekernel> never mind the xilinx error messages, this software is full of crap, so just fix the ones that block you
<aw> cd build && xst -ifn ../system.xst
<aw> /bin/sh: xst: not found
<aw> make: *** [build/system.ngc] Error 127
<aw> so never mind, right?
<lekernel> not that one
<lekernel> did you run
<lekernel> export PATH=$PATH:/opt/Xilinx/13.1/ISE_DS/ISE/bin/lin
<lekernel> which was supposed to fix that?
<lekernel> export PATH=$PATH:/opt/Xilinx/13.1/ISE_DS/ISE/bin/lin
<lekernel> does it work now?
<aw> running..now .:-)
<lekernel> ok, good
<lekernel> once it has finished, you should have a file build/system.bit
<lekernel> verify that you can load it with urjtag. loading it should make your board boot (it's the soc design)
<aw> phel,, xiangfu, the PATH is only worked well as the folder I faced Xiangfu told me. man. :(
<lekernel> (use pld load)
<aw> okay. got it
<aw> after building, i used 'pld load' to flash 'SoC' bit stream. is the work now, right?
<aw> so later you will teach us to modify 'pull down', right?
<lekernel> do not flash, load
<aw> okay..'load'
<lekernel> just "pld load" does not modify the flash
<aw> so this 'pld load' is to 'load' system.bit into fpga, exactly right?
<lekernel> yes
<aw> oah! thanks correcting me the words differently. ;-)
<xiangfu> after run that. there are a lot of "Minimac RX FIFO overflow!" come out in serial console.
<xiangfu> wait. I reboot the mm1. and   pld load system.bit again. the mm1 can boot to flickernoise.
<aw> mine is creating bit map.
<xiangfu> lekernel, aw: http://pastebin.com/A69460Kt
<lekernel> and did the board boot?
<lekernel> sounds good...
<xiangfu> lekernel:yes. boot fine.
<lekernel> ok, now open boards/milkymist-one/rtl/system.v
<lekernel> and as you can see you have a line "module system(" followed by the list of all signals going in and out of the fpga
<lekernel> this is the top level verilog file
<lekernel> in this list you can see the vga signals are there:
<lekernel> output vga_psave_n,
<lekernel> output vga_hsync_n,
<lekernel> output vga_vsync_n,
<lekernel> output [7:0] vga_r,
<lekernel> (...)
<xiangfu> yes
<lekernel> if you scroll down a bit you see that they go to a submodule called vga (around line 950)
<lekernel> .vga_psave_n(vga_psave_n),
<lekernel> .vga_hsync_n(vga_hsync_n),
<lekernel> .vga_vsync_n(vga_vsync_n),
<lekernel> .vga_r(vga_r),
<xiangfu> yes
<lekernel> so what you do is 1. disconnect those signals from the vga submodule
<lekernel> so you delete all the lines that refer to the VGA signals from the vga submodule (from ".vga_psave_n(vga_psave_n)," to ".vga_sdc(vga_sdc)")
<lekernel> and don't forget to remove the comma at the end of ".dcb_hit(dcb_hit),"
<lekernel> 2. ground those signals
<lekernel> for each signal add a line
<lekernel> assign vga_r = 0;
<lekernel> or
<lekernel> assign vga_psave_n = 1; (to set them to VCC)
<lekernel> do this after the end of the vga submodule (i.e. immediately after the ");")
<lekernel> once you have assigned the values you want to each VGA signal (0 or 1) go to the synthesis folder again and re-run make -f Makefile.xst and use urjtag
<lekernel> btw if you want the FPGA not to drive a signal, use 1'bz, e.g. assign vga_sda = 1'bz;
<xiangfu> lekernel: is this correct:  http://pastebin.com/L27dRm9A
<lekernel> yes, sounds good
<roh> ha. /me just ordered a dozend sbm-20 geiger tubes
<lekernel> but you should use 0 for clock, r, g, b etc.
<lekernel> and 1 for the *_n signals
<aw> lekernel, after 'pld load' done, power cycle, should I use 'pld load' again, or it don't need since it's already existed inside fpga?
<lekernel> aw: you don't have to power cycle, urjtag will erase the previously loaded .bit file
<aw> okay, i think i also done with verifying load .bit file. now follow them again.
<xiangfu> lekernel: like this: "http://pastebin.com/vTjC6qqS"
<xiangfu> is those code at the right place?
<xiangfu> I got some error: http://pastebin.com/GSXHhuuS
<xiangfu> oh. I should using ''assign'' right?
<lekernel> yes, assign
<xiangfu> xiangfu: ok. after add the 'assign' compile continue now :)
<nats`> plop
<xiangfu> Phase 9.8  Global Placement ...
<xiangfu> 14mins passed. still running:   Running physical synthesis...
<xiangfu> finally. it's finished.
<xiangfu> I still got the sound noise after the the serial output "RTEMS SHELL (Ver.1.0-FRC):/dev/console. Mar 14 2011. "
<xiangfu> during the boot. the earphone is quiet. after RTEMS SHELL show up. I got noise in my earphone.
<xiangfu> (like an old TV without any signal)
<lekernel> ok. not very surprising i'd say, but at least you can check now
<xiangfu> this noise is not very obvious  with my Desktop Speaker (2.1 speaker)
<lekernel> yup... that's what I said... sometimes it's very obvious, sometimes you barely notice it
<lekernel> but I don't know if this is because the noise amplitude actually varies of if it only depends on the response of speakers and environment
<aw> xiangfu, mine is still running. you needs to listenning carefully the differences before/after we load a 'pull down' on RGB wires.
<lekernel> we should get some scope measurements...
<lekernel> or just measure on scope. don't listen
<aw> yes, just listening probably hard to compare..
<aw> if there's no bigger differences.
<xiangfu> can I mute the audio in in RTEMS shell?
<lekernel> no
<aw> measuring on audio will be not like normal probing for scope. but I could only verify if there's obvious noise between 20Hz ~ 20Khz
<lekernel> what's wrong with measuring noise on scope?
<aw> it's some sort of frequency v.s. magnitude, my scope i think probably should not distinguish them. even they are all have same magnitudes
<aw> lekernel, I'll try to compare both of them(different system.v) to probe. I am saying audio frequency response is hard to probe ..well..i'll try to measure during static state.
<aw> 'but I don't know if this is because the noise amplitude actually varies of if it only depends on the response of speakers and environment' >> agreed.
<aw> so a better measurement is good for catching.  well..so far at least thanks you taught us though on modifying 'pull high & low' tasks.
<aw> but this is not recommended to modify if people don't know pins definitions thorough.
<aw> my 'system.bit' is created.
<aw> yes, from my site results of only listening, they are the same loud noise. don't have clearly different though.
<kristianpaul> ah, _out_ means vga :-)
<kristianpaul> hi xiangfu, sorry i was sleeping at that time, but seems you managed already :-)
<aw> lekernel,  i used speaker too. so yes, we _out_ & clarify that surely this is not caused by VGA RGB radiative/inductive noises influence.
<lekernel> ok, so let's not modify anything on the vga layout in rc3
<aw> well....but modification about that known issue on layout/routing is easy. you know. why not? ;-)
<aw> lekernel, one question, after 'pull down' RGB submodules, why after RTEMS run i can still see monitor? won't it be frozen on screen?
<lekernel> this just disconnects the FPGA I/O pins, the video controller is still running inside
<kristianpaul> hmm
<aw> hum? if they are all disconnected with FPGA I/O, why ADV7125 still have analog out to vga monitor? I still can not understand.
<aw> i was supposed that we like to 'disconnect' RGB digital/parallel signals, so there's no any analog vga encoded to RGB components to vga connector. so I was thought I should not see any in monitor.
<lekernel> aw: ah, you mean you still have a picture?!
<lekernel> on the screen?
<lekernel> no, this isn't normal
<lekernel> how did you modify the system.v?
<lekernel> and are you reloading correctly the new bitstream with urjtag?
<lekernel> you've probably made a mistake somewhere. of course, this should completely prevent the monitor from displaying anything.
<aw> yes, I forgot to ask xiangfu if he see nothing on vga monitor then.
<lekernel> set vga_clk = 0
<lekernel> not tri-state
<aw> yeah..let me checked them again.
<lekernel> this doesn't explain your problem, but this signal shouldn't float anyway
<lekernel> I guess you are sending an old system.bit to the board
<aw> but i run 'jtag' under ':~/milkymist/boards/milkymist-one/synthesis/build$ sudo jtag', ti should not be wrong. :-)
<aw> well..check again...:-)
<lekernel> and you have run "make -f Makefile.xst" before, right?
<aw> yes.
<aw> and export PATH before "make..--"
<aw> making....now
<aw> phase 9.8..
<xiangfu> aw: the VGA monitor is black. nothing on it. I saw the boot progress on serial output
<aw> xiangfu, must be mistakes on my making.
<aw> i knew it now, once successfully on 'pld load system.bit' then screen is black.
<aw> lekernel, i should carefully listen after done 'pld load system.bit' , right?
<aw> no need to power cycle or i need ?
<lekernel> no power cycle
<lekernel> after pld load, your board should boot without any picture on vga
<lekernel> (and if you measure the voltages on the adv7125 they should match the levels set in the verilog)
<aw> okay so i have the same with serial out log with 'Minimac RX FIFO overflow' msg. then monitor is black and no more loud noise.
<Fallenou> :(
<aw> i turned maximum on my speaker without no audio input but still plug in audio cable in. second...checking.
<aw> xiangfu, hope you confirm it again.
<lekernel> if you get "minimac rx fifo overflow", it's a bug that prevents the board from booting
<lekernel> you can't draw any conclusion if you get this message. just reboot until the message goes.
<lekernel> you should only measure output noise when you get "RTEMS SHELL ..."
<aw> um...seems my making steps is still somethings wrong. after i power cycle and shows up "RTEMS SHELL ..." but screen is still have.
<aw> so yeah..no conclusion at all now.
<lekernel> NEVER power cycle
<lekernel> if you have to power cycle, you're doing it wrong
<aw> um..so my steps of making was somewhere wrong already.
<methril_work> nice MMOne load & hack session
<lekernel> aw: apply power, run urjtag, type "pld load", and it boots your new bitstream
<lekernel> done
<lekernel> don't power cycle, don't touch the buttons
<aw> umm..i was wrong on touching the buttons and power cycle though.
<aw> okay..so before/after 'pld load system.bit'...is the same.
<aw> done. tks for teaching.
<lekernel> it's the same?
<lekernel> can you ask xiangfu? he got it to work
<methril_work> if i`ll catch it properly load is like openocd/gdb load command (it loads the "sw" into the memory, but you loose the changes if you power cycle)
<lekernel> yeah that's what it does
<aw> lekernel, i'll confirm with xiangfu tomorrow. I got the same results.
<lekernel> aw: but did the VGA out go off or not?
<aw> lekernel, go off surely.
<lekernel> ah, ok!
<lekernel> well, good, then
<lekernel> everything normal :)
<aw> methril_work, i have no any idea on s/w, but today yes, thanks lekernel to let us confirm this experiments initially
<aw> yup.
<methril_work> aw, it was a nice class ;)
<aw> dinner time here. bbl all.
<methril_work> today i`ve time to test my MMOne
<methril_work> so i learn how to load some bits
<methril_work> thnakyou lekernel
<Fallenou> what a bad name
<Fallenou> sounds like java
<kristianpaul> oh
<kristianpaul> ah, haskell :-)
<Fallenou> is turning crazy with PIC shitty compiler and linker
<Fallenou> how do you tell gcc to put all the code of a .c (or each function) in a specific section ?
<lekernel> -ffunction-sections
<Fallenou> and then tell the linker to put this section to a specific address
<Fallenou> -ffunction-sections section_name ?
<lekernel> ah sorry, read too fast
<lekernel> no, this puts each function in a separate section
<Fallenou> ok
<lekernel> for the address, you must use a linker script
<lars_> you'll have to write a linker script
<Fallenou> in my linker script I have a section boot starting at address 0x0
<Fallenou> but by default gcc puts the functions in the section "page"
<Fallenou> so it's not going into my "boot" section ...
<Fallenou> lars_: I have one
<Fallenou> how do I tell fuckin gcc to put the code into "boot" section
<lars_> __attribute__(section("boot"))
<Fallenou> oh ! crap I put the boot section "protected"
<Fallenou> lars_: yes and with a 500 years old gcc ?
<Fallenou> I guess there is no __attribute__ at all
<lars_> what version of gcc are you using?
<Fallenou> checking
<lekernel> there's no __attribute__ at all?!
<Fallenou> it's mcc18 actully
<Fallenou> don't even know if it's gcc
<Fallenou> or just gcc based
<Fallenou> or just not gcc at all
<lars_> mathlab compiler?
<Fallenou> microchip c compiler
<Fallenou> for pic18
<Fallenou> it's clearly a shitty compiler
<lekernel> probably not gcc
<Fallenou> when there is an error it says "syntax error line XX"
<Fallenou> nothing more
<lekernel> sounds like the typical chipmaker software
<Fallenou> anyway I think it's ok now
<Fallenou> I removed "protected" from the linker script section
<kristianpaul> pic 18 gcc?
<kristianpaul> hmm
<kristianpaul> is sdcc too bad for your app?
<Fallenou> yes
<Fallenou> sdcc does not work with my pic
<Fallenou> Work is in progress on supporting the Microchip PIC16 and PIC18 series <=
<kristianpaul> hmm
<kristianpaul> i had no problem with 2.3 sdcc version
<kristianpaul> but i guess my requirements are not so big
<lekernel> Fallenou: why don't you use an avr?
<kristianpaul> s2.3/3
<kristianpaul> Fallenou: What you want to do with the pic18?
<lekernel> I've had pretty much the same experience as you with PICs ...
<kristianpaul> always used PICs AVR are no wide spread in our cuntry..
<kristianpaul> ;-)
<kristianpaul> is 18F or 18C ?
<Fallenou> 18F2580
<Fallenou> lekernel: dunno, it's not my choice
<Fallenou> kristianpaul: control a motor, doing PID, receiving orders via CAN
<Fallenou> lekernel: pic32 is pretty nice though !
<Fallenou> but this time it's really gcc
<Fallenou> deboguing works nice too
<kristianpaul> yeah pic32 are nice
<kristianpaul> ah, well i never worked with CAN.. :(
<Fallenou> i'm doing a lot of can and ethercat stuff
<Fallenou> and spi
<tuxbrain> Fallenou :(spi) then maybe I will ask you for help at one point with atmega and Nanonote :P
<Fallenou> ok, I did some spi with attiny and pic32
<Fallenou> maybe I could help :o
<methril> Fallenou, i use SDCC for a lot of PIC devices at work (i motivated the change from Hi-Tech compilers to SDCC)
<methril> Fallenou, most of them works or are easy to add support
<methril> mcc18 is not GCC based (AFAIK)
<Fallenou> yes it seems so
<methril> i used mcc18 in other works
<Fallenou> well in my office they used sdcc sometimes
<Fallenou> and  to run automated tests too
<methril> yes, is the next step
<methril> for us
<Fallenou> but at least during development we use the "normal" toolchain
<Fallenou> provided by the vendor
<Fallenou> with mplab, and their debuger
<methril> SDCC has some known bugs, but there are workarounds
<Fallenou> can you do debug when you use sdcc ?
<methril> through serial line & LEDs /PINs
<Fallenou> I mean single step
<Fallenou> dumping memory
<Fallenou> changing PC
<Fallenou> break points
<methril> with a scope and some other tools is more real-time friendly
<Fallenou> I use a led and a scope too some time
<Fallenou> but real debugging is really usefull
<methril> when i've to debug something like limits, i use the gpsim
<methril> it's
<methril> sometimes
<Fallenou> gpsim ?
<methril> i used to do it with ReaICE
<methril> gpsim is a PIC simulator
<Fallenou> oh ok
<Fallenou> but you cannot simulate the environnement
<methril> it support some processors
<Fallenou> like an incomming CAN message
<methril> you can not
<Fallenou> or ADC you speak to with SPI
<methril> it has modules to do something like this
<methril> with SPI you can
<Fallenou> I don't think you can really replace the real-time debugging
<methril> there are modules that implement a SPI device
<Fallenou> nice :)
<methril> no, but when you have no way to debug, and you don't have the toolchain... ;)
<Fallenou> yes sure
<Fallenou> you have a lot of replacement solutions
<methril> the pain is getting the serial working for the first time
<Fallenou> but it's really hacks and workarounds
<Fallenou> but indeed you can get by with scope+leds+serial
<methril> i program in Linux, but nobody hacked the Debugging
<methril> isee a ICD home-made and looks like it was "working" but i never tested
<Fallenou> is it expensive the ICD 3 thing ?
<Fallenou> I use one at work
<Fallenou> (btw scope are expensive too :p)
<methril> it is (ate least here)
<Fallenou> oh ok
<methril> scopes are expensive, but they usually have one in electric labs :)
<methril> i prefer PicKit2 than ICD2
<methril> i didn't check ICD3
<Fallenou> i'm using the icd3
<methril> i teste RealICE, and works ok
<Fallenou> because I do pic18F *and* pic32
<Fallenou> I guess you can't do pic32 with icd2
<Fallenou> (I didn't test)
<Fallenou> some of my colleagues use icd2 though
<methril> i don't know
<methril> we are migrating to ColdFire v!
<methril> v1
<Fallenou> oh freescale ?
<methril> yes
<methril> i had better experience with their uP
<methril> (HCS11/12/12X)
<Fallenou> never tested
<Fallenou> I just did some avr + pic18/32
<methril> are like small PPCs
<Fallenou> i'm noob :)
<methril> i prefer other archs, let's see what lm32 gives us ;)
<Fallenou> sure !
<Fallenou> pic18 instruction set is nice though
<methril> for assembler are easy
<Fallenou> you can pretty much program in assembly
<Fallenou> without that much pain
<Fallenou> and translate assembly to C
<Fallenou> easily
<methril> yes, but is a mess when you deal with pointers
<Fallenou> hum maybe yes
<Fallenou> didn't try
<methril> i see a Microchip engineer doing a LLVM port for PIC18 devices
<methril> but it stopped
<Fallenou> oh :/
<methril> if you want to dig with compilers, you could help :)
<Fallenou> for the moment I don't have time for big tasks unfortunately :/
<methril> oh!! for your problem, you could use: #pragma code func_space
<methril> and when this functionends, #pragma code
<methril> to "restore" the pragma sentence
<Fallenou> hum
<methril> later on the linker, you could use the NAME=func_space
<Fallenou> you mean #pragma code section_name
<Fallenou> ?
<methril> yes
<Fallenou> before the function
<methril> yes
<Fallenou> the pragma explanation in MPLAB C18 compiler user guide is hard to understand
<methril> something like this: #pragma code boot_func
<Fallenou> the doc is really sucky on this point
<methril> fvoid func (void) {
<methril> }
<methril> #pragma code
<Fallenou> hum ok
<methril> on the linker you put
<Fallenou> the thing is I need to put everything inside my c file (everything inside the project actually) inside a specific section
<methril> SECTION_NAME=boot=func
<Fallenou> so I just put protected everywhere, except on this section :)
<Fallenou> and all my functions goes into this section
<Fallenou> I needed *one* particular function to go at address 0
<Fallenou> so I put just for this one a specific pragma
<Fallenou> with like #pragma code func_name=0x0000
<methril> when you define a code section, you could use later on (1 or more functions)
<methril> if you specify this in the .c file, you don need to do it into the linker, but it cleaner to have it there too
<Fallenou> one thing I haven't sorted out yet, it how to put a function "inline"
<Fallenou> I tried several syntax without success
<Fallenou> is**
<methril> there is no way
<Fallenou> :(
<Fallenou> really too bad
<Fallenou> It could save me several instructions
<methril> at least i never had success
<Fallenou> and I don't want to use macros
<methril> maybe mixing assembler you could
<methril> but i not a C18 expert
<Fallenou> hum dunno if I can do
<Fallenou> _asm
<Fallenou> bra symbol_name_in_C
<Fallenou> _endasm
<methril> you could
<methril> bra or goto (as is inline)
<Fallenou> but it could only work for functions without arguments
<Fallenou> but anyway most of my functions does not take args
<Fallenou> it's really a "simple" code, it's a 512 bytes bootloader
<methril> you could do the same that the stackdoes in assembler
<Fallenou> hum yes but it adds too much complexity
<methril> it adds
<Fallenou> don't want to follow function call rules in assembly and stuff
<Fallenou> if I start to do that, I should do everything in assembly
<Fallenou> I wanted to keep it simple and to stick with C
<methril> hehehe
<methril> better
<methril> it's hard to maintain assembler code
<Fallenou> to ease the maintainability of the code :)
<Fallenou> yes
<methril> use it as few as possible
<Fallenou> actually I had already a lot of legacy working CAN code in assembly
<Fallenou> I translated it into C for my boot loader lol
<Fallenou> So I really could have done it in assembly without too much problems
<methril> :)
<Fallenou> but really C is much more readable
<methril> well, bbl, i'm going to cook something
<Fallenou> (even if I agree , on pic18 it's not that bad)
<Fallenou> :)
<Fallenou> bon appetit!
<methril> merci