C
Cory Shol
Hi everyone,
I am coding up a project to route and control Gigabit ethernet.
Basically the FPGA receives MDIO communication from Processor 1 or Processor 2( Both masters, only one can be master at a time).
The logic decides based on a priority and a keep alive signal which master controls the MDIO bus.
Now I have the handling for who is master of the system and keep alive signal etc...
My question lies with the Asynchronous With Select and When Else Statements:
my code looks something like below: (Keep in mind MDIO communication is BIDIRECTIONAL, I have a pull up on the mdio_proc1 pin)
The question is about the Nested When else in the the With select statement:
with arb_select_proc1_iso & smi_control select
mdio_proc1 <= ('Z' when (direction = '0' or mdio_device_data = '1') else '0') when "001",
arb_proc1_out_iso when "100",
arb_proc1_out_iso when "101",
arb_proc1_out_iso when "110",
arb_proc1_out_iso when "111",
'Z' when others;
with arb_select_proc2_iso & smi_control select
mdio_proc2 <= ('Z' when (direction = '0' or mdio_device_data = '1') else '0') when "010",
arb_proc2_out_iso when "100",
arb_proc2_out_iso when "101",
arb_proc2_out_iso when "110",
arb_proc2_out_iso when "111",
'Z' when others;
This comes up with the error in Xilinx:
ERROR:HDLParsers:164 - "C:/workspace/head/Smm_xilinx_tb/smm/smm.vhd" Line 325. parse error, unexpected WHEN, expecting COMMA or CLOSEPAR
ERROR:HDLParsers:164 - "C:/workspace/head/Smm_xilinx_tb/smm/smm.vhd" Line 333. parse error, unexpected WHEN, expecting COMMA or CLOSEPAR
So I try this:
mdio_bus <= 'Z' when (direction = '0' or mdio_device_data = '1') else '0';
with arb_select_proc1_iso & smi_control select
mdio_proc1 <= mdio_bus when "001",
arb_proc1_out_iso when "100",
arb_proc1_out_iso when "101",
arb_proc1_out_iso when "110",
arb_proc1_out_iso when "111",
'Z' when others;
with arb_select_proc2_iso & smi_control select
mdio_mezz <= mdio_bus when "010",
arb_proc2_out_iso when "100",
arb_proc2_out_iso when "101",
arb_proc2_out_iso when "110",
arb_proc2_out_iso when "111",
'Z' when others;
and I get the warning:
WARNING:Xst:2042 - Unit smm: 2 internal tristates are replaced by logic (pull-up yes): mdio_bus, mdio_proc_data.
Are there any other ways to do what I want to do??
I am coding up a project to route and control Gigabit ethernet.
Basically the FPGA receives MDIO communication from Processor 1 or Processor 2( Both masters, only one can be master at a time).
The logic decides based on a priority and a keep alive signal which master controls the MDIO bus.
Now I have the handling for who is master of the system and keep alive signal etc...
My question lies with the Asynchronous With Select and When Else Statements:
my code looks something like below: (Keep in mind MDIO communication is BIDIRECTIONAL, I have a pull up on the mdio_proc1 pin)
The question is about the Nested When else in the the With select statement:
with arb_select_proc1_iso & smi_control select
mdio_proc1 <= ('Z' when (direction = '0' or mdio_device_data = '1') else '0') when "001",
arb_proc1_out_iso when "100",
arb_proc1_out_iso when "101",
arb_proc1_out_iso when "110",
arb_proc1_out_iso when "111",
'Z' when others;
with arb_select_proc2_iso & smi_control select
mdio_proc2 <= ('Z' when (direction = '0' or mdio_device_data = '1') else '0') when "010",
arb_proc2_out_iso when "100",
arb_proc2_out_iso when "101",
arb_proc2_out_iso when "110",
arb_proc2_out_iso when "111",
'Z' when others;
This comes up with the error in Xilinx:
ERROR:HDLParsers:164 - "C:/workspace/head/Smm_xilinx_tb/smm/smm.vhd" Line 325. parse error, unexpected WHEN, expecting COMMA or CLOSEPAR
ERROR:HDLParsers:164 - "C:/workspace/head/Smm_xilinx_tb/smm/smm.vhd" Line 333. parse error, unexpected WHEN, expecting COMMA or CLOSEPAR
So I try this:
mdio_bus <= 'Z' when (direction = '0' or mdio_device_data = '1') else '0';
with arb_select_proc1_iso & smi_control select
mdio_proc1 <= mdio_bus when "001",
arb_proc1_out_iso when "100",
arb_proc1_out_iso when "101",
arb_proc1_out_iso when "110",
arb_proc1_out_iso when "111",
'Z' when others;
with arb_select_proc2_iso & smi_control select
mdio_mezz <= mdio_bus when "010",
arb_proc2_out_iso when "100",
arb_proc2_out_iso when "101",
arb_proc2_out_iso when "110",
arb_proc2_out_iso when "111",
'Z' when others;
and I get the warning:
WARNING:Xst:2042 - Unit smm: 2 internal tristates are replaced by logic (pull-up yes): mdio_bus, mdio_proc_data.
Are there any other ways to do what I want to do??