📄 first_nios2_system.v
字号:
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
1'b0,
button_pio_s1_irq_from_sa,
system_timer_s1_irq_from_sa,
jtag_uart_avalon_jtag_slave_irq_from_sa};
//no_byte_enables_and_last_term, which is an e_register
always @(posedge clk or negedge reset_n)
begin
if (reset_n == 0)
cpu_data_master_no_byte_enables_and_last_term <= 0;
else if (1)
cpu_data_master_no_byte_enables_and_last_term <= last_dbs_term_and_run;
end
//compute the last dbs term, which is an e_mux
assign last_dbs_term_and_run = (cpu_data_master_dbs_address == 2'b11) & cpu_data_master_write & !cpu_data_master_byteenable_ext_flash_s1;
//pre dbs count enable, which is an e_mux
assign pre_dbs_count_enable = (((~cpu_data_master_no_byte_enables_and_last_term) & cpu_data_master_requests_ext_flash_s1 & cpu_data_master_write & !cpu_data_master_byteenable_ext_flash_s1)) |
cpu_data_master_read_data_valid_ext_flash_s1 |
((cpu_data_master_granted_ext_flash_s1 & cpu_data_master_write & 1 & ({ext_flash_s1_wait_counter_eq_0 & ~d1_ext_ram_bus_avalon_slave_end_xfer})));
//input to dbs-8 stored 0, which is an e_mux
assign p1_dbs_8_reg_segment_0 = incoming_ext_ram_bus_data_with_Xs_converted_to_0;
//dbs register for dbs-8 segment 0, which is an e_register
always @(posedge clk or negedge reset_n)
begin
if (reset_n == 0)
dbs_8_reg_segment_0 <= 0;
else if (dbs_count_enable & ((cpu_data_master_dbs_address[1 : 0]) == 0))
dbs_8_reg_segment_0 <= p1_dbs_8_reg_segment_0;
end
//input to dbs-8 stored 1, which is an e_mux
assign p1_dbs_8_reg_segment_1 = incoming_ext_ram_bus_data_with_Xs_converted_to_0;
//dbs register for dbs-8 segment 1, which is an e_register
always @(posedge clk or negedge reset_n)
begin
if (reset_n == 0)
dbs_8_reg_segment_1 <= 0;
else if (dbs_count_enable & ((cpu_data_master_dbs_address[1 : 0]) == 1))
dbs_8_reg_segment_1 <= p1_dbs_8_reg_segment_1;
end
//input to dbs-8 stored 2, which is an e_mux
assign p1_dbs_8_reg_segment_2 = incoming_ext_ram_bus_data_with_Xs_converted_to_0;
//dbs register for dbs-8 segment 2, which is an e_register
always @(posedge clk or negedge reset_n)
begin
if (reset_n == 0)
dbs_8_reg_segment_2 <= 0;
else if (dbs_count_enable & ((cpu_data_master_dbs_address[1 : 0]) == 2))
dbs_8_reg_segment_2 <= p1_dbs_8_reg_segment_2;
end
//mux write dbs 2, which is an e_mux
assign cpu_data_master_dbs_write_8 = ((cpu_data_master_dbs_address[1 : 0] == 0))? cpu_data_master_writedata[7 : 0] :
((cpu_data_master_dbs_address[1 : 0] == 1))? cpu_data_master_writedata[15 : 8] :
((cpu_data_master_dbs_address[1 : 0] == 2))? cpu_data_master_writedata[23 : 16] :
cpu_data_master_writedata[31 : 24];
//dbs count increment, which is an e_mux
assign cpu_data_master_dbs_increment = (cpu_data_master_requests_ext_flash_s1)? 1 :
0;
//dbs counter overflow, which is an e_assign
assign dbs_counter_overflow = cpu_data_master_dbs_address[1] & !(next_dbs_address[1]);
//next master address, which is an e_assign
assign next_dbs_address = cpu_data_master_dbs_address + cpu_data_master_dbs_increment;
//dbs count enable, which is an e_mux
assign dbs_count_enable = pre_dbs_count_enable;
//dbs counter, which is an e_register
always @(posedge clk or negedge reset_n)
begin
if (reset_n == 0)
cpu_data_master_dbs_address <= 0;
else if (dbs_count_enable)
cpu_data_master_dbs_address <= next_dbs_address;
end
//unpredictable registered wait state incoming data, which is an e_register
always @(posedge clk or negedge reset_n)
begin
if (reset_n == 0)
registered_cpu_data_master_readdata <= 0;
else if (1)
registered_cpu_data_master_readdata <= p1_registered_cpu_data_master_readdata;
end
//registered readdata mux, which is an e_mux
assign p1_registered_cpu_data_master_readdata = {32 {~cpu_data_master_requests_jtag_uart_avalon_jtag_slave}} | jtag_uart_avalon_jtag_slave_readdata_from_sa;
// synthesis attribute cpu_data_master_arbitrator auto_dissolve FALSE
endmodule
module cpu_instruction_master_arbitrator (
// inputs:
clk,
cpu_instruction_master_address,
cpu_instruction_master_granted_cpu_jtag_debug_module,
cpu_instruction_master_granted_ext_flash_s1,
cpu_instruction_master_granted_ext_ram_s1,
cpu_instruction_master_qualified_request_cpu_jtag_debug_module,
cpu_instruction_master_qualified_request_ext_flash_s1,
cpu_instruction_master_qualified_request_ext_ram_s1,
cpu_instruction_master_read,
cpu_instruction_master_read_data_valid_cpu_jtag_debug_module,
cpu_instruction_master_read_data_valid_ext_flash_s1,
cpu_instruction_master_read_data_valid_ext_ram_s1,
cpu_instruction_master_requests_cpu_jtag_debug_module,
cpu_instruction_master_requests_ext_flash_s1,
cpu_instruction_master_requests_ext_ram_s1,
cpu_jtag_debug_module_readdata_from_sa,
d1_cpu_jtag_debug_module_end_xfer,
d1_ext_ram_bus_avalon_slave_end_xfer,
ext_flash_s1_wait_counter_eq_0,
incoming_ext_ram_bus_data,
reset_n,
// outputs:
cpu_instruction_master_address_to_slave,
cpu_instruction_master_dbs_address,
cpu_instruction_master_latency_counter,
cpu_instruction_master_readdata,
cpu_instruction_master_readdatavalid,
cpu_instruction_master_waitrequest
);
output [ 23: 0] cpu_instruction_master_address_to_slave;
output [ 1: 0] cpu_instruction_master_dbs_address;
output [ 1: 0] cpu_instruction_master_latency_counter;
output [ 31: 0] cpu_instruction_master_readdata;
output cpu_instruction_master_readdatavalid;
output cpu_instruction_master_waitrequest;
input clk;
input [ 23: 0] cpu_instruction_master_address;
input cpu_instruction_master_granted_cpu_jtag_debug_module;
input cpu_instruction_master_granted_ext_flash_s1;
input cpu_instruction_master_granted_ext_ram_s1;
input cpu_instruction_master_qualified_request_cpu_jtag_debug_module;
input cpu_instruction_master_qualified_request_ext_flash_s1;
input cpu_instruction_master_qualified_request_ext_ram_s1;
input cpu_instruction_master_read;
input cpu_instruction_master_read_data_valid_cpu_jtag_debug_module;
input cpu_instruction_master_read_data_valid_ext_flash_s1;
input cpu_instruction_master_read_data_valid_ext_ram_s1;
input cpu_instruction_master_requests_cpu_jtag_debug_module;
input cpu_instruction_master_requests_ext_flash_s1;
input cpu_instruction_master_requests_ext_ram_s1;
input [ 31: 0] cpu_jtag_debug_module_readdata_from_sa;
input d1_cpu_jtag_debug_module_end_xfer;
input d1_ext_ram_bus_avalon_slave_end_xfer;
input ext_flash_s1_wait_counter_eq_0;
input [ 31: 0] incoming_ext_ram_bus_data;
input reset_n;
reg active_and_waiting_last_time;
reg [ 23: 0] cpu_instruction_master_address_last_time;
wire [ 23: 0] cpu_instruction_master_address_to_slave;
reg [ 1: 0] cpu_instruction_master_dbs_address;
wire [ 1: 0] cpu_instruction_master_dbs_increment;
reg [ 1: 0] cpu_instruction_master_dbs_rdv_counter;
wire [ 1: 0] cpu_instruction_master_dbs_rdv_counter_inc;
wire cpu_instruction_master_is_granted_some_slave;
reg [ 1: 0] cpu_instruction_master_latency_counter;
wire [ 1: 0] cpu_instruction_master_next_dbs_rdv_counter;
reg cpu_instruction_master_read_but_no_slave_selected;
reg cpu_instruction_master_read_last_time;
wire [ 31: 0] cpu_instruction_master_readdata;
wire cpu_instruction_master_readdatavalid;
wire cpu_instruction_master_waitrequest;
wire dbs_count_enable;
wire dbs_counter_overflow;
reg [ 7: 0] dbs_latent_8_reg_segment_0;
reg [ 7: 0] dbs_latent_8_reg_segment_1;
reg [ 7: 0] dbs_latent_8_reg_segment_2;
wire dbs_rdv_count_enable;
wire dbs_rdv_counter_overflow;
wire dummy_sink;
wire [ 1: 0] latency_load_value;
wire [ 1: 0] ne
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -