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
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];
	}
}
 

EDALIST

Full Member level 2
Full Member level 2
Joined
Nov 27, 2004
Messages
130
Helped
12
Reputation
24
Reaction score
0
Trophy points
1,296
Activity points
992
this is because handle-c is sequental you should put a par statement

par
{
x
y
x
}
 

    CMOS

    Points: 2
    Helpful Answer Positive Rating

samcheetah

Advanced Member level 2
Advanced Member level 2
Joined
May 25, 2004
Messages
645
Helped
39
Reputation
78
Reaction score
10
Trophy points
1,298
Location
Pakistan
Activity points
6,916
does this mean you cant put parallelism in your design with Handel-C???????????
 

EDALIST

Full Member level 2
Full Member level 2
Joined
Nov 27, 2004
Messages
130
Helped
12
Reputation
24
Reaction score
0
Trophy points
1,296
Activity points
992
it actually say you can, just remember to put the par { } before
assigments.
 

samcheetah

Advanced Member level 2
Advanced Member level 2
Joined
May 25, 2004
Messages
645
Helped
39
Reputation
78
Reaction score
10
Trophy points
1,298
Location
Pakistan
Activity points
6,916
okay so par means parallel??? is that right?
 

CMOS

Advanced Member level 3
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
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;
 

EDALIST

Full Member level 2
Full Member level 2
Joined
Nov 27, 2004
Messages
130
Helped
12
Reputation
24
Reaction score
0
Trophy points
1,296
Activity points
992
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

CMOS

Advanced Member level 3
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
EDALIST, you seem to be a Guru of Handel-C. I will try that out. :)
 

CMOS

Advanced Member level 3
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
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.
 

EDALIST

Full Member level 2
Full Member level 2
Joined
Nov 27, 2004
Messages
130
Helped
12
Reputation
24
Reaction score
0
Trophy points
1,296
Activity points
992
here is dk 4 handlec user guide
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top