--==============================================================================
-- CERN (BE-CO-HT)
-- Pulse counter registers wbgen2 description file (pulsetest gateware)
--==============================================================================
--
-- author: Theodor Stana (t.stana@cern.ch)
--
-- date of creation:
--
-- version: 1.0
--
-- description:
--    This file contains the register description for the pulse counter
--    registers and is to be used as input to the wbgen2 tool for generating
--    an appropriate VHDL file.
--
--==============================================================================
-- GNU LESSER GENERAL PUBLIC LICENSE
--==============================================================================
-- This source file is free software; you can redistribute it and/or modify it
-- under the terms of the GNU Lesser General Public License as published by the
-- Free Software Foundation; either version 2.1 of the License, or (at your
-- option) any later version. This source is distributed in the hope that it
-- will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-- See the GNU Lesser General Public License for more details. You should have
-- received a copy of the GNU Lesser General Public License along with this
-- source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
--==============================================================================
-- last changes:
--    03-05-2014   Theodor Stana     Added GPL header
--==============================================================================
-- TODO: -
--==============================================================================

peripheral {
  name = "Pulse counter registers";
  description = "Registers containing the values for input and output generated pulses";
  hdl_entity = "pulse_cnt_regs";
  prefix     = "pulse_cnt";

  reg {
    name = "CH1 input";
    prefix = "ch1i";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };
  reg {
    name = "CH1 output";
    prefix = "ch1o";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };

  reg {
    name = "CH2 input";
    prefix = "ch2i";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };
  reg {
    name = "CH2 output";
    prefix = "ch2o";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };

  reg {
    name = "CH3 input";
    prefix = "ch3i";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };
  reg {
    name = "CH3 output";
    prefix = "ch3o";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };

  reg {
    name = "CH4 input";
    prefix = "ch4i";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };
  reg {
    name = "CH4 output";
    prefix = "ch4o";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };

  reg {
    name = "CH5 input";
    prefix = "ch5i";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };
  reg {
    name = "CH5 output";
    prefix = "ch5o";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };

  reg {
    name = "CH6 input";
    prefix = "ch6i";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };
  reg {
    name = "CH6 output";
    prefix = "ch6o";
    field {
      name = "number of pulses";
      prefix = "val";
      type = SLV;
      size = 32;
      access_bus = READ_ONLY;
      access_dev = WRITE_ONLY;
    };
  };

  reg {
    name = "Counter reset";
    prefix = "rst";
    field {
      name = "reset";
      prefix = "bit";
      type = BIT;
    };
  };
};
