Guest
Hi,
I am playing around with writing a toy vhdl/verilog like language and
as part of it I want to emit c-code.
The language only allows synthesizable logic to be described and forces
you to decide what sort of variable you declare - combinatorial or
registered. There are no always blocks with sensitivity lists nor any
# style delays. Everything is either combinatorial or updated by an
implicit clock.
I have a verilog generator which seems to work but C is a little
harder. In C I have to deal with sensitivity lists and delta cycles
somehow, particularly for combinational logic. I was wondering if it
is possible to do so without having to run the process multiple times
until the values "settle". I have written some logic which orders the
signal assignments and as far as I can see this should be sufficient,
but I am just not convinced there isn't a simple counter example I
haven't considered.
For example;
always @ *
begin
b = a + 5;
a = c;
end
Swap the above two assignments and you could evaluate this in one pass.
Cheers,
Andy
I am playing around with writing a toy vhdl/verilog like language and
as part of it I want to emit c-code.
The language only allows synthesizable logic to be described and forces
you to decide what sort of variable you declare - combinatorial or
registered. There are no always blocks with sensitivity lists nor any
# style delays. Everything is either combinatorial or updated by an
implicit clock.
I have a verilog generator which seems to work but C is a little
harder. In C I have to deal with sensitivity lists and delta cycles
somehow, particularly for combinational logic. I was wondering if it
is possible to do so without having to run the process multiple times
until the values "settle". I have written some logic which orders the
signal assignments and as far as I can see this should be sufficient,
but I am just not convinced there isn't a simple counter example I
haven't considered.
For example;
always @ *
begin
b = a + 5;
a = c;
end
Swap the above two assignments and you could evaluate this in one pass.
Cheers,
Andy