From: Stephane Guyetant Newsgroups: comp.arch.fpga Subject: content of a LUT Date: Thu, 26 Jun 2003 17:13:23 +0200 Organization: Irisa, Rennes (FR) Lines: 13 Message-ID: NNTP-Posting-Host: tarifa.irisa.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.irisa.fr 1056640403 5234 131.254.61.73 (26 Jun 2003 15:13:23 GMT) X-Complaints-To: usenet@irisa.fr NNTP-Posting-Date: 26 Jun 2003 15:13:23 GMT User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!switch.ch!news.mailgate.org!newsfeed.stueberl.de!kibo.news.demon.net!demon!mephistopheles.news.clara.net!news.clara.net!usenet-fr.net!freenix!jussieu.fr!univ-angers.fr!news.univ-rennes1.fr!irisa.fr!not-for-mail Xref: chonsp.franklin.ch comp.arch.fpga:29999 say we have LUT into the .XDL file that is: (the slice is for example CLB_R18C30.S0) G:dev/TIMER/un2_r_counter_348:#LUT:D=(A1*(A2*(A3*A4))) A LUT is basically a RAM with a 4bits address access so that the corresponding LUT should contain: 0x8000 because only one bit should be set to '1', the one pointed by address 0xF. Correct? Now I want to change some constant and my new logical equation is for example D=(A1+A3). What if I parse the .BIT and write (jbits or similar) at the accurate location 0xCCFF? ###### Path: chonsp.franklin.ch!not-for-mail From: Neil Franklin Newsgroups: comp.arch.fpga Subject: Re: content of a LUT Date: 26 Jun 2003 21:49:35 +0200 Organization: My own Private Self Lines: 59 Message-ID: <6uhe6c39gw.fsf@chonsp.franklin.ch> References: NNTP-Posting-Host: chonsp.franklin.ch X-Trace: chonsp.franklin.ch 1056656975 1071 10.0.3.2 (26 Jun 2003 19:49:35 GMT) X-Complaints-To: news@chonsp.franklin.ch NNTP-Posting-Date: 26 Jun 2003 19:49:35 GMT X-Newsreader: Gnus v5.7/Emacs 20.4 Xref: chonsp.franklin.ch comp.arch.fpga:30039 Stephane Guyetant writes: > LUT:D=(A1*(A2*(A3*A4))) > > A LUT is basically a RAM with a 4bits address access so that the > corresponding LUT should contain: 0x8000 because only one bit should be > set to '1', the one pointed by address 0xF. Correct? Yes. Strictly it has 7FFF in it, because the bits are inverted. But that is hidden in any decent software. > Now I want to change some constant and my new logical equation is for > example D=(A1+A3). What if I parse the .BIT and write (jbits or similar) > at the accurate location 0xCCFF? Then it will do A1+A3, if you had the right value. JBits is ideal for such stuff, such as in this code: // do this once, quasi library functions // config bit constants for abstracting position in CLB final public static int LutFunction[][][][] = { { LUT.SLICE0_F, LUT.SLICE0_G }, { LUT.SLICE1_F, LUT.SLICE1_G } }; // call the JBits stuff to do it // Row, Col, Sli, Lut are globals, set elsewhere, could also be params public static void lut(int Function) { try { Fpga.set(Row, Col, LutFunction[Sli][Lut], Util.InvertIntArray(Util.IntToIntArray(Function, 16))); } catch (ConfigurationException Ce) { // pos() converts Row, Col, Sli, Lut to cccs/rrrl format string System.out.println("Configuration exeption in lut() at " + pos()); System.out.println(Ce); } } // constants for making up functions, computer does this for you :-) // so A1+A3 = A1 OR A3 = I1|I3 = 0xAAAA|0xF0F0 = 0xFAFA final public static int I1 = 0xAAAA, I2 = 0xCCCC, I3 = 0xF0F0, I4 = 0xFF00; // do this for every LUT needing changing // example function, a 2:1 Mux, I1 or I2, selected by I3 lut(I1&(~I3)|I2&I3); Lots of more details of JBits usage in: http://neil.franklin.ch/Projects/PDP-10/pdp10.java -- Neil Franklin, neil@franklin.ch.remove http://neil.franklin.ch/ Hacker, Unix Guru, El Eng HTL/BSc, Programmer, Archer, Blacksmith - hardware runs the world, software controls the hardware code generates the software, have you coded today?