Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Xilinx LogiCore Block Problem

Status
Not open for further replies.

koshmar29

Newbie level 4
Joined
Dec 15, 2014
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
36
Hello,

I want to use the Divider Generator v3.0 in Xilinx Webpack v14.7 to perform division on my Spartan 3E. I generated a block using the following settings :
Algorithm type: radix2
Dividend and Quotient Width: 12 bit
Divisor Width: 12 bit
Remainder Type: Remainder
Fractional Width: 12
Operand Sign: Signed
Latency Configuration: AUtomatic
Latency: 16
Clocks per Division: 1

I wrote a simple testbench simulating various dividends and divisors, but no matter what I do the quotient is always 0. I'm not using any external signals to control the divider, so I'm confused as to why it's not working. I have limited experience working with the LogiCore Blocks, so if anybody can help me set it up properly, I'd greatly appreciate it.
 

Can you post your testbench and perhaps the ISIM or Modelsim waveforms of the ports of the Divider core?
 

In addition to ads-ee's request, best also to post the .xco file for the divider core. That way others can reproduce your testbench should that be required.
 

I uploaded the .xco file along with my testbench and its waveform.
Thank you for your assistance~
 

Attachments

  • divider.zip
    30.7 KB · Views: 42

I just looked at your simulation output.

You are manually generating the clock, therefore you've only generated four rising clock edges. The .xco file has a latency setting of 16, which means you need 16 clocks from the time the input data is applied to the dividend and divisor inputs until the quotient and fractional outputs are available.

Try using something like this inside your testbench instead of the brute force assignments...


Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
initial begin
    clk = 0;
    forever #10 clk = clk;
  end
 
  initial begin
    // apply a reset for 100 ns
    rst = 1;
    # 100;
    rst = 0;
  end
 
  always @(posedge clk) begin
    if (rst) begin
      dividend = 0;
      divisor = 0;
    end else begin
      dividend = $random;
      divisor = $random;
    end
  end



Note: code is untested.
 
I just looked at your simulation output.

You are manually generating the clock, therefore you've only generated four rising clock edges. The .xco file has a latency setting of 16, which means you need 16 clocks from the time the input data is applied to the dividend and divisor inputs until the quotient and fractional outputs are available.

Try using something like this inside your testbench instead of the brute force assignments...


Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
initial begin
    clk = 0;
    forever #10 clk = clk;
  end
 
  initial begin
    // apply a reset for 100 ns
    rst = 1;
    # 100;
    rst = 0;
  end
 
  always @(posedge clk) begin
    if (rst) begin
      dividend = 0;
      divisor = 0;
    end else begin
      dividend = $random;
      divisor = $random;
    end
  end



Note: code is untested.


Thanks for your suggestion. I tried running your testbench and the output is coming out all wrong (see waveform).

test.JPG
 

hi
Thanks for your suggestion. I tried running your testbench and the output is coming out all wrong (see waveform).
nothing is wrong in those outputs. check every input after 16 clockcycle .your latency will be 16 clock cycle for a 12 bit input. so output will come after 16 clockcycle.

regards
 
Last edited:

Ah, thank you for pointing it out.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top