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.

Handel-C Vs Verilog Speed Difference!

Status
Not open for further replies.

CMOS

Advanced Member level 3
Joined
Jan 6, 2004
Messages
862
Helped
94
Reputation
186
Reaction score
50
Trophy points
1,308
Location
USA
Activity points
5,673
I just tried this simple LED blinking code in Verilog and Handel-C. The result I got was stunning. The verilog version blinks LED at much faster rate than Handel-C version on the same FPGA board. Can anyone explain the reason!

Here are the codes
1. Verilog
Code:
module LEDBlink(led1, led2, clk);
input clk;
output led1;
output led2;

reg [23:0] cnt;
always @(posedge clk) cnt<=cnt+24'h1;
assign led1 = cnt[20] & cnt[22] & cnt[23];
assign led2 = cnt[23];

endmodule

2. Handel-C Code
Code:
set clock = external "10" with {rate = 24, standard = "LVTTL"};

unsigned int 1 led1;
interface bus_out() led_pin1(unsigned int 1 led_pin1 = led1) with {data={"97"}, standard = "LVTTL"};

unsigned int 1 led2;
interface bus_out() led_pin2(unsigned int 1 led_pin2 = led2) with {data={"91"}, standard = "LVTTL"};

void main(void)
{
	unsigned int 24 cnt;
	while(1)
	{
		cnt++;
		led1 = cnt[20] & cnt[22] & cnt[23];
		led2 = cnt[23];
	}
}
 

this is because handle-c is sequental you should put a par statement

par
{
x
y
x
}
 

    CMOS

    Points: 2
    Helpful Answer Positive Rating
does this mean you cant put parallelism in your design with Handel-C???????????
 

it actually say you can, just remember to put the par { } before
assigments.
 

okay so par means parallel??? is that right?
 

samcheetah said:
okay so par means parallel??? is that right?
Yes par = parallel and seq = sequential. By default all statement execute sequentially unless written in par block.

EDALIST said:
this is because handle-c is sequental you should put a par statement

par
{
x
y
x
}

Yes that works! Silly me..how could I forget that thing :D Thanks.


One more thing. Can you tell me how do you define high impedance state in Handel-C. I want to convert this Verilog statement to Handel-C,
Code:
assign FX2_FD = FIFO_DATAOUT_OE ? FIFO_DATAOUT : 8'hZZ;
 

AN EXAMPLE FOR BUS :

interface bus_ts_clock_in (int 4 read)
BiBus(int 4 writePort=x+1,
unsigned 1 enable=condition)
with {data = {"P4", "P3", "P2", "P1"}};

condition = 0; // Tri-state external pins
x = BiBus.read; // Read registered value
condition = 1; // Drive x+1 onto the pins
 

    CMOS

    Points: 2
    Helpful Answer Positive Rating
EDALIST, you seem to be a Guru of Handel-C. I will try that out. :)
 

Hey EDALIST, can you name some good tutorial/e-book/book on Handel-C? The Celoxica manual doesnt seem complete as I cant find many things in it. Our school has DK2.0.
 

here is dk 4 handlec user guide
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top