Problems rebuilding Pavel's LED Blinker

Applications, development tools, FPGA, C, WEB
Post Reply
JPCoetzee1
Posts: 8
Joined: Sun Sep 24, 2017 9:53 am

Problems rebuilding Pavel's LED Blinker

Post by JPCoetzee1 » Fri Oct 20, 2017 10:11 am

I can build Pavel's LED Blinker project and create a bootable SD card but I am having problems changing and RE-building it. I've made a small change to the LED blinking module red_pitaya_hk.v

Code: Select all

// LED blinking
reg  [  8-1: 0] led_reg ;      
reg  [ 32-1: 0] led_cnt ;      

always @(posedge clk_i) begin
   if (rstn_i == 1'b0) begin
      led_reg[0] <=  1'b0 ;
      led_reg[1] <=  1'b0 ;
      led_reg[2] <=  1'b0 ;
      led_reg[3] <=  1'b0 ;
      led_reg[4] <=  1'b0 ;
      led_reg[5] <=  1'b0 ;
      led_reg[6] <=  1'b0 ;
      led_reg[7] <=  1'b0 ;
      led_cnt    <= 32'h0 ;
   end
   else begin
      led_reg[0] <= led_cnt[28] ;
      led_reg[1] <= led_cnt[27] ;
      led_reg[2] <= led_cnt[26] ;
      led_reg[3] <= led_cnt[25] ;
      led_reg[4] <= led_cnt[24] ;
      led_reg[5] <= led_cnt[29] ;
      led_reg[6] <= led_cnt[29] ;
      led_reg[7] <= led_cnt[29] ;
      led_cnt    <= led_cnt + 32'h1 ;
   end
end
I've commented out the line allowing the system to write to the LED register, to make sure that the only thing turning the LEDs on and off is the above code

Code: Select all

// if (sys_addr_i[19:0]==20'h30)   led_reg[7:1] <= sys_wdata_i[8-1:1]
Before re-running the build scripts I delete the red_pitaya_0_92/tmp directory to force a complete re-synthesis by Vivado. However, no matter what I do only LED[0] flashes at 1Hz i.e. exactly the same as the original build. Either Vivado is not re-synthesising red_pitaya_hk.v or the script is re-downloading the file from github, but I can't find that anywhere in the scripts.

I'm not an expert in Verilog (I am a VHDL engineer) but I understand the code.

Can anybody help? Many thanks

pavel
Posts: 789
Joined: Sat May 23, 2015 5:22 pm

Re: Problems rebuilding Pavel's LED Blinker

Post by pavel » Fri Oct 20, 2017 10:17 am

Since red_pitaya_0_92 and my LED blinker are two different projects, I'm not sure if you're modifying the project that you're trying to rebuild.

It would help me to understand the problem if you could list the commands that you're running.

JPCoetzee1
Posts: 8
Joined: Sun Sep 24, 2017 9:53 am

Re: Problems rebuilding Pavel's LED Blinker

Post by JPCoetzee1 » Fri Oct 20, 2017 3:20 pm

Ha ha! Well, that would explain it! The commands I run are those from your page at http://pavel-demin.github.io/red-pitaya ... d-blinker/ i.e:

Building boot.bin, devicetree.dtb and uImage:

Code: Select all

make NAME=led_blinker all
Building a bootable SD card: (NB I think this one fails, because the USB stick is not connected to the VirtualBox Debian session so there is no device at mmcblk0).

Code: Select all

sudo sh scripts/debian.sh /dev/mmcblk0
SD card image
Building a bootable SD card image:

Code: Select all

sudo sh scripts/image.sh scripts/debian.sh red-pitaya-debian-8.6-armhf.img 1024
I use Win32 Disk Imager to create a new SD bootable SD card.

pavel
Posts: 789
Joined: Sat May 23, 2015 5:22 pm

Re: Problems rebuilding Pavel's LED Blinker

Post by pavel » Fri Oct 20, 2017 3:33 pm

Thanks for the commands. So, they are building the led_blinker project.

The source code of this project is in

https://github.com/pavel-demin/red-pita ... design.tcl

You can find some more details about why I'm using Tcl as a hardware description language in my Club Vivado presentation (slides 90-111):

http://www.origin.xilinx.com/publicatio ... ations.zip

JPCoetzee1
Posts: 8
Joined: Sun Sep 24, 2017 9:53 am

Re: Problems rebuilding Pavel's LED Blinker

Post by JPCoetzee1 » Sat Oct 21, 2017 9:10 am

Bingo! I tweaked this cell in block_design.tcl:

Code: Select all

# Create xlslice
cell xilinx.com:ip:xlslice:1.0 slice_0 {
  DIN_WIDTH 32 DIN_FROM 26 DIN_TO 24 DOUT_WIDTH 3
} {
  Din cntr_0/Q
  Dout led_o
}
That changed the LED flashing.

Thanks for your help.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 26 guests