Только начинаю осваивать ПЛИС. Написал на AHDL код вот такого лог. элемента.
Код
subdesign sstv_decoder
( XI[7..0]: input = gnd;
YI[10..0]: input = gnd;
sync_pulse: output;
clear_pulse: output;
count_reset: output;
)
variable
level_sync: node;
frame_sync: node;
row_sync: node;
clear_node: node;
begin
if((XI[] > 216) and (XI[] < 255)) then
level_sync = vcc;
else
level_sync = gnd;
end if;
if((XI[] > 17) and (XI[] < 255)) then
frame_sync = vcc;
else
frame_sync = gnd;
end if;
if((XI[] > 11) and (XI[] < 47)) then
clear_node = vcc;
else
clear_node = gnd;
end if;
if(((YI[0],XI[]) > 36) and ((YI[0],XI[]) < 511)) then
row_sync = vcc;
else
row_sync = gnd;
end if;
--count_reset section
if(YI[] < 1250) then
count_reset = vcc;
else
count_reset = gnd;
end if;
--level and frame sync pulse section
if((YI[] < 10) or ((YI[] > 619) and (YI[] < 634)) or (YI[] > 1243)) then
clear_pulse = gnd;
if((YI[] < 5) or ((YI[] > 624) and (YI[] < 630))) then
sync_pulse = frame_sync;
else
sync_pulse = level_sync;
end if;
else
sync_pulse = row_sync;
clear_pulse = clear_node;
end if;
end;
( XI[7..0]: input = gnd;
YI[10..0]: input = gnd;
sync_pulse: output;
clear_pulse: output;
count_reset: output;
)
variable
level_sync: node;
frame_sync: node;
row_sync: node;
clear_node: node;
begin
if((XI[] > 216) and (XI[] < 255)) then
level_sync = vcc;
else
level_sync = gnd;
end if;
if((XI[] > 17) and (XI[] < 255)) then
frame_sync = vcc;
else
frame_sync = gnd;
end if;
if((XI[] > 11) and (XI[] < 47)) then
clear_node = vcc;
else
clear_node = gnd;
end if;
if(((YI[0],XI[]) > 36) and ((YI[0],XI[]) < 511)) then
row_sync = vcc;
else
row_sync = gnd;
end if;
--count_reset section
if(YI[] < 1250) then
count_reset = vcc;
else
count_reset = gnd;
end if;
--level and frame sync pulse section
if((YI[] < 10) or ((YI[] > 619) and (YI[] < 634)) or (YI[] > 1243)) then
clear_pulse = gnd;
if((YI[] < 5) or ((YI[] > 624) and (YI[] < 630))) then
sync_pulse = frame_sync;
else
sync_pulse = level_sync;
end if;
else
sync_pulse = row_sync;
clear_pulse = clear_node;
end if;
end;
Ко входам IX и IY подключается 19-и разрядный счетчик, причем IX - младшие разряды счетчика. Старшие разряды ( от YI ) сбрасываются выходом count_reset.
Вобщем то пока вся схема. Анализирую выходы sync_pulse и clear_pulse.
После компиляции получилось задействованных 35 lcells, при чем 20 непосредственно в схеме. Для остальных компилятор применил термин shareable. Я так понимаю, что забрал у них входную логику а сами триггеры еще как то можно будет использовать в последствии.
Так вот собственно вопрос. Есть ли какие то методы оптимизации кода, в частности, приведенного выше, или может быть есть какие то методы-приемы уменьшения расхода входной логики ячеек.