My view was to be able to capture enough information about components
that a more sophisticated drc could be applied.

This proposal doesn't yet include the complexity of a bom being able to
reference multiple equivelent components or to support the concept of
pick generic part do schematic then pick more specific part.

I hope the comments in the file are explanitory enough.

Thanks,

Steve Meier
----------------------------------------------------------------------------------------------------
-- AKEDA SQL COMPONENT DATABASE
--
-- Copyright (C) 2007 Stephen F. Meier
--
-- This code is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public
-- License as published by the Free Software Foundation; either
-- version 2 of the License, or (at your option) any later version.
--
-- This library 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
-- Library General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
--

----------------------------------------------------------------------------------------------------
-- sq denotes a sequence
-- tb denotes a table 

----------------------------------------------------------------------------------------------------
-- a bank is a collection of pins which share the same logic family
-- a bank includes io pins and may include power pins

----------------------------------------------------------------------------------------------------
-- a slot is a collection of pins which are grouped together because 
--      they are part of the same logical function

----------------------------------------------------------------------------------------------------
-- io pins belong to one or more slots
-- power pins belong to a bank 
-- slots belong to a bank
-- banks belong to components

-- For example a 7400
-- 1 bank with four slots and 2 power pins
-- slot 1 has pins 1 and 2 are inputs 3 is an output
-- slot 2 has pins 4 and 5 are inputs 6 is an output
-- slot 3 has pins 9 and 10 are inputs 8 is an output
-- slot 4 has pins 12 and 13 are inputs 11 is an output
-- pins 7 and 14 are power pins

----------------------------------------------------------------------------------------------------

CREATE SEQUENCE "sq_component_type" start 1 increment 1 NO MAXVALUE minvalue 1 cache 1;

CREATE TABLE "tb_component_type" (
	"component_type_key" integer DEFAULT nextval('sq_component_type'::text) NOT NULL,
	"type_name"          text,
	"description"        text,       
	"partnumberbase"     text,    -- all parts of this type will have this value as their base
	"bom_use_count"      integer, -- track number of boms that use this component
	"is_document"        bool,    -- true if this is a document
	"has_bom"            bool,    -- does this component have sub components
        "state"              text,
	"history"            bool     -- false if this is an active record
);

----------------------------------------------------------------------------------------------------

CREATE SEQUENCE "sq_logic_family" start 1 increment 1 NO MAXVALUE minvalue 1 cache 1;

CREATE TABLE "tb_logic_family" (
	"logic_family_key"   integer DEFAULT nextval('sq_logic_family'::text) NOT NULL, 
	"description"        text,
	"low_out_max"        float,   -- to be logic low must be below this value
	"high_out_min"       float,   -- to be logic high must be above this value
	"low_in_max"         float,   -- to be logic low must be below this value
	"high_in_min"        float,   -- to be logic high must be above this value
	"differential"	     bool,
	"diff_voltage"       float,
	"history"            bool     -- false if this is an active record
);

----------------------------------------------------------------------------------------------------

CREATE SEQUENCE "sq_component" start 1 increment 1 NO MAXVALUE minvalue 1 cache 1;

CREATE TABLE "tb_component" (
	"component_key"      integer DEFAULT nextval('sq_component'::text) NOT NULL,
	"part_number"	     text,
	"description"        text,
        "package"            text,
	"footprint"          text,    -- pin numbering schemes may require explicit footprint pattern declaration
	"value"	             integer,
	"unit"	             text,    -- e.g. mAmps, uHenries 
	"history"            bool     -- false if this is an active record
);

----------------------------------------------------------------------------------------------------

CREATE SEQUENCE "sq_bank" start 1 increment 1 NO MAXVALUE minvalue 1 cache 1;

CREATE TABLE "tb_bank" (
	"bank_key"           integer DEFAULT nextval('sq_bank'::text) NOT NULL, 
	"component_key"      integer,   -- parent component this bank belongs to
	"logic_family_key"   integer,   -- logic family bank is dedicated to
	"history"            bool       -- false if this is an active record
);

----------------------------------------------------------------------------------------------------

CREATE SEQUENCE "sq_slot" start 1 increment 1 NO MAXVALUE minvalue 1 cache 1;

CREATE TABLE "tb_slot" (
	"slot_key"           integer DEFAULT nextval('sq_slot'::text) NOT NULL, 
	"bank_key"           integer,   -- parent bank this slot belongs to
	"history"            bool       -- false if this is an active record
);

----------------------------------------------------------------------------------------------------
-- table to map pin to slots. A i/o pin on an fpga can belong to one or more slots
--    used single ended it can be swapped with any other pin in the io bank
--    used differential (if possible), it and its partner can be swapped with another differential pair
--        in the same io bank
--    some pins serve dual purposes such as configuration pins and then as io pins  

CREATE SEQUENCE "sq_pin_to_slot" start 1 increment 1 NO MAXVALUE minvalue 1 cache 1;

CREATE TABLE "tb_pin_to_slot" (
	"p_to_s_key"         integer DEFAULT nextval('sq_pin_to_slot'::text) NOT NULL,
	"pin_key"            integer,
	"slot_position"      integer, -- location of pin in slot
	"history"            bool     -- false if this is an active record
);

----------------------------------------------------------------------------------------------------

CREATE SEQUENCE "sq_pin" start 1 increment 1 NO MAXVALUE minvalue 1 cache 1;

CREATE TABLE "tb_pin" (
	"pin_key"            integer DEFAULT nextval('sq_pin'::text) NOT NULL,
	"component_key"      integer, -- device pin belongs too should be null if pin belongs to a bank
	"bank_key"           integer, -- io bank pin belongs too
	"pin_number"         text,    -- pin number needed for netlist generation
	"type"               integer, -- input, output, in/out, power, nc
	"differential"	     bool,    -- TRUE if a differential
	"diff_partner"       integer, -- pin_key of the partner of this pin if this pin is a differential pin
	"diff_complement"    bool,    -- TRUE if a differential and is the complement member of the pair
	"min_out_high"       text,    -- contains an equation used to determine minium output voltage when driven high
	"max_out_low"        text,    -- contains an equation used to determine maximum output voltage when driven low
	"max_v"              text,    -- contains an equation used to determine absolute maximum voltage to be applied to this pin
	"min_v"              text,    -- contains an equation used to determine absolute minimum voltage to be applied to this pin
	"history"            bool     -- false if this is an active record
);

----------------------------------------------------------------------------------------------------


_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to