OpenCores
URL https://opencores.org/ocsvn/can/can/trunk

Subversion Repositories can

[/] [can/] [tags/] [rel_22/] [rtl/] [verilog/] [can_registers.v] - Diff between revs 102 and 104

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 102 Rev 104
Line 48... Line 48...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.28  2003/07/07 11:21:37  mohor
 
// Little fixes (to fix warnings).
 
//
// Revision 1.27  2003/06/22 09:43:03  mohor
// Revision 1.27  2003/06/22 09:43:03  mohor
// synthesi full_case parallel_case fixed.
// synthesi full_case parallel_case fixed.
//
//
// Revision 1.26  2003/06/22 01:33:14  mohor
// Revision 1.26  2003/06/22 01:33:14  mohor
// clkout is clk/2 after the reset.
// clkout is clk/2 after the reset.
Line 186... Line 189...
  release_buffer,
  release_buffer,
  abort_tx,
  abort_tx,
  tx_request,
  tx_request,
  self_rx_request,
  self_rx_request,
  single_shot_transmission,
  single_shot_transmission,
 
  tx_state,
 
  tx_state_q,
 
 
  /* Arbitration Lost Capture Register */
  /* Arbitration Lost Capture Register */
  read_arbitration_lost_capture_reg,
  read_arbitration_lost_capture_reg,
 
 
  /* Error Code Capture Register */
  /* Error Code Capture Register */
Line 307... Line 312...
output        release_buffer;
output        release_buffer;
output        abort_tx;
output        abort_tx;
output        tx_request;
output        tx_request;
output        self_rx_request;
output        self_rx_request;
output        single_shot_transmission;
output        single_shot_transmission;
 
input         tx_state;
 
input         tx_state_q;
 
 
/* Arbitration Lost Capture Register */
/* Arbitration Lost Capture Register */
output        read_arbitration_lost_capture_reg;
output        read_arbitration_lost_capture_reg;
 
 
/* Error Code Capture Register */
/* Error Code Capture Register */
Line 391... Line 398...
reg           error_status_q;
reg           error_status_q;
reg           node_bus_off_q;
reg           node_bus_off_q;
reg           node_error_passive_q;
reg           node_error_passive_q;
reg           transmit_buffer_status;
reg           transmit_buffer_status;
reg           single_shot_transmission;
reg           single_shot_transmission;
 
reg           self_rx_request;
 
 
 
 
// Some interrupts exist in basic mode and in extended mode. Since they are in different registers they need to be multiplexed.
// Some interrupts exist in basic mode and in extended mode. Since they are in different registers they need to be multiplexed.
wire          data_overrun_irq_en;
wire          data_overrun_irq_en;
wire          error_warning_irq_en;
wire          error_warning_irq_en;
Line 514... Line 522...
( .data_in(data_in[0]),
( .data_in(data_in[0]),
  .data_out(command[0]),
  .data_out(command[0]),
  .we(we_command),
  .we(we_command),
  .clk(clk),
  .clk(clk),
  .rst(rst),
  .rst(rst),
  .rst_sync(tx_request & sample_point)
  .rst_sync(command[0] & sample_point)
);
);
 
 
can_register_asyn_syn #(1, 1'h0) COMMAND_REG1
can_register_asyn_syn #(1, 1'h0) COMMAND_REG1
( .data_in(data_in[1]),
( .data_in(data_in[1]),
  .data_out(command[1]),
  .data_out(command[1]),
  .we(we_command),
  .we(we_command),
  .clk(clk),
  .clk(clk),
  .rst(rst),
  .rst(rst),
  .rst_sync(abort_tx & ~transmitting)
  .rst_sync(sample_point & (tx_request | (abort_tx & ~transmitting)))
);
);
 
 
can_register_asyn_syn #(2, 2'h0) COMMAND_REG
can_register_asyn_syn #(2, 2'h0) COMMAND_REG
( .data_in(data_in[3:2]),
( .data_in(data_in[3:2]),
  .data_out(command[3:2]),
  .data_out(command[3:2]),
Line 541... Line 549...
( .data_in(data_in[4]),
( .data_in(data_in[4]),
  .data_out(command[4]),
  .data_out(command[4]),
  .we(we_command),
  .we(we_command),
  .clk(clk),
  .clk(clk),
  .rst(rst),
  .rst(rst),
  .rst_sync(tx_successful & (~tx_successful_q) | abort_tx)
  .rst_sync(command[4] & sample_point)
);
);
 
 
assign self_rx_request = command[4] & (~command[0]);
 
 
always @ (posedge clk or posedge rst)
 
begin
 
  if (rst)
 
    self_rx_request <= 1'b0;
 
  else if (command[4] & (~command[0]))
 
    self_rx_request <=#Tp 1'b1;
 
  else if ((~tx_state) & tx_state_q)
 
    self_rx_request <=#Tp 1'b0;
 
end
 
 
 
 
assign clear_data_overrun = command[3];
assign clear_data_overrun = command[3];
assign release_buffer = command[2];
assign release_buffer = command[2];
assign abort_tx = command[1] & (~command[0]) & (~command[4]);
 
assign tx_request = command[0] | command[4];
assign tx_request = command[0] | command[4];
 
assign abort_tx = command[1] & (~tx_request);
 
 
 
 
always @ (posedge clk or posedge rst)
always @ (posedge clk or posedge rst)
begin
begin
  if (rst)
  if (rst)
    single_shot_transmission <= 1'b0;
    single_shot_transmission <= 1'b0;
  else if (we_command & data_in[1] & (data_in[1] | data_in[4]))
  else if (tx_request & command[1] & sample_point)
    single_shot_transmission <=#Tp 1'b1;
    single_shot_transmission <=#Tp 1'b1;
  else if (tx_successful & (~tx_successful_q))
  else if ((~tx_state) & tx_state_q)
    single_shot_transmission <=#Tp 1'b0;
    single_shot_transmission <=#Tp 1'b0;
end
end
 
 
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.