gpio.xml

Sat, 06 Aug 2011 01:43:24 +0100

author
Philip Pemberton <philpem@philpem.me.uk>
date
Sat, 06 Aug 2011 01:43:24 +0100
changeset 1
dfc32cad81ba
parent 0
267b5a25932f
permissions
-rw-r--r--

Update to latest Lattice code dump (LM32 V3.8, GPIO V3.2)

Version : 3.2
Mod. Data : Jun 6, 2010
Changes Made : 1. Provide capability to read/write bytes (when GPIO larger than 8 bits wide)
2. Provide capability to use a 32-bit or 8-bit data bus on the WISHBONE slave port
3. Perform a big-endian to little-endian conversion in hardware

philpem@0 1 <?xml version="1.0" encoding="UTF-8"?>
philpem@1 2 <Component Name="gpio" Text="GPIO" Type="IO" Ver="3.3" Help="gpio\document\gpio.htm" Processor="LM32,LM8" LatticeFamily="All" Device="All">
philpem@0 3 <MasterSlavePorts>
philpem@0 4 <SlavePort Prefix="GPIO" Name="GP I/O Port" Type="DATA,DMAR,DMAW"/>
philpem@0 5 </MasterSlavePorts>
philpem@0 6 <ClockPort Name="CLK_I" Description="Clock one"/>
philpem@0 7 <ResetPort Name="RST_I" Description="Reset"/>
philpem@0 8 <Interrupt Name="IRQ_O" Active="high" IRQ=""/>
philpem@0 9 <ExternalPorts>
philpem@0 10 <ExternalPort Name="PIO_IN" Type="input" Width="DATA_WIDTH" Condition="INPUT_PORTS_ONLY" />
philpem@0 11 <ExternalPort Name="PIO_BOTH_IN" Type="input" Width="INPUT_WIDTH" Condition="BOTH_INPUT_AND_OUTPUT" />
philpem@0 12 <ExternalPort Name="PIO_OUT" Type="output" Width="DATA_WIDTH" Condition="OUTPUT_PORTS_ONLY" />
philpem@0 13 <ExternalPort Name="PIO_BOTH_OUT" Type="output" Width="OUTPUT_WIDTH" Condition="BOTH_INPUT_AND_OUTPUT" />
philpem@0 14 <ExternalPort Name="PIO_IO" Type="inout" Width="DATA_WIDTH" Condition="TRISTATE_PORTS" />
philpem@0 15 </ExternalPorts>
philpem@0 16 <DeviceDriver InitRoutine="MicoGPIOInit" StructName="MicoGPIOCtx_t">
philpem@1 17 <DDInclude Include = "LookupServices.h" Processor="LM32"/>
philpem@1 18 <DDInclude Include = "stddef.h" Processor="LM8"/>
philpem@1 19 <DDIRQ IRQAPI="MicoGPIOISR" Parameter="InstanceName" Include="MicoGPIO.h" Processor="LM8"/>
philpem@1 20 <DDPreProcessor Name="__MICOGPIO_USER_IRQ_HANDLER__" Processor="LM8"/>
philpem@1 21 <DDstruct>
philpem@1 22 <DDSElem MemberName = "name" MemberType = "const char*" Type = "Parm" Value = "InstanceName" Format="string" Processor="LM32,LM8"/>
philpem@1 23 <DDSElem MemberName = "base" MemberType = "unsigned int" Type = "Parm" Value = "BASE_ADDRESS" Processor="LM32"/>
philpem@1 24 <DDSElem MemberName = "base" MemberType = "size_t" Type = "Parm" Value = "BASE_ADDRESS" Processor="LM8"/>
philpem@1 25 <DDSElem MemberName = "lookupReg" MemberType = "DeviceReg_t" Type="uninitialized" Value="" Processor="LM32"/>
philpem@1 26 <DDSElem MemberName = "intrLevel" MemberType = "unsigned int" Type = "Interrupt" Value = "IRQ_LEVEL" Processor="LM32"/>
philpem@1 27 <DDSElem MemberName = "intrLevel" MemberType = "unsigned char" Type = "Interrupt" Value = "IRQ_LEVEL" Processor="LM8"/>
philpem@1 28 <DDSElem MemberName = "output_only" MemberType = "unsigned int" Type = "Parm" Value = "OUTPUT_PORTS_ONLY" Processor="LM32"/>
philpem@1 29 <DDSElem MemberName = "output_only" MemberType = "unsigned int" Type = "Parm" Value = "OUTPUT_PORTS_ONLY" Processor="LM8"/>
philpem@1 30 <DDSElem MemberName = "input_only" MemberType = "unsigned int" Type = "Parm" Value = "INPUT_PORTS_ONLY" Processor="LM32"/>
philpem@1 31 <DDSElem MemberName = "input_only" MemberType = "unsigned char" Type = "Parm" Value = "INPUT_PORTS_ONLY" Processor="LM8"/>
philpem@1 32 <DDSElem MemberName = "in_and_out" MemberType = "unsigned int" Type = "Parm" Value = "BOTH_INPUT_AND_OUTPUT" Processor="LM32"/>
philpem@1 33 <DDSElem MemberName = "in_and_out" MemberType = "unsigned char" Type = "Parm" Value = "BOTH_INPUT_AND_OUTPUT" Processor="LM8"/>
philpem@1 34 <DDSElem MemberName = "tristate" MemberType = "unsigned int" Type = "Parm" Value = "TRISTATE_PORTS" Processor="LM32"/>
philpem@1 35 <DDSElem MemberName = "tristate" MemberType = "unsigned char" Type = "Parm" Value = "TRISTATE_PORTS" Processor="LM8"/>
philpem@1 36 <DDSElem MemberName = "data_width" MemberType = "unsigned int" Type = "Parm" Value = "DATA_WIDTH" Processor="LM32"/>
philpem@1 37 <DDSElem MemberName = "data_width" MemberType = "unsigned char" Type = "Parm" Value = "DATA_WIDTH" Processor="LM8"/>
philpem@1 38 <DDSElem MemberName = "input_width" MemberType = "unsigned int" Type = "Parm" Value = "INPUT_WIDTH" Processor="LM32"/>
philpem@1 39 <DDSElem MemberName = "input_width" MemberType = "unsigned char" Type = "Parm" Value = "INPUT_WIDTH" Processor="LM8"/>
philpem@1 40 <DDSElem MemberName = "output_width" MemberType = "unsigned int" Type = "Parm" Value = "OUTPUT_WIDTH" Processor="LM32"/>
philpem@1 41 <DDSElem MemberName = "output_width" MemberType = "unsigned char" Type = "Parm" Value = "OUTPUT_WIDTH" Processor="LM8"/>
philpem@1 42 <DDSElem MemberName = "intr_enable" MemberType = "unsigned int" Type = "Parm" Value = "IRQ_MODE" Processor="LM32"/>
philpem@1 43 <DDSElem MemberName = "intr_enable" MemberType = "unsigned char" Type = "Parm" Value = "IRQ_MODE" Processor="LM8"/>
philpem@1 44 <DDSElem MemberName = "wb_data_size" MemberType = "unsigned int" Type = "Parm" Value = "WB_DAT_WIDTH" Processor="LM32"/>
philpem@1 45 <DDSElem MemberName = "prev" MemberType = "void *" Type = "uninitialized" Value = "" Processor="LM32"/>
philpem@1 46 <DDSElem MemberName = "next" MemberType = "void *" Type = "uninitialized" Value = "" Processor="LM32"/>
philpem@0 47 </DDstruct>
philpem@0 48 </DeviceDriver>
philpem@0 49 <Files>
philpem@1 50 <File Name="../components/gpio/rtl/verilog/gpio.v"/>
philpem@1 51 <File Name="../components/gpio/rtl/verilog/tpio.v"/>
philpem@0 52 </Files>
philpem@0 53 <Parms>
philpem@1 54 <Parm Name="InstanceName" Value="gpio" Type="string" isiname="true" Text="Instance Name"/>
philpem@1 55 <Parm Name="BASE_ADDRESS" Value="0x80000000" Type="Integer" isba="true" Text="Base Address"/>
philpem@1 56 <Parm Name="SIZE" Value="16" Type="Integer" issize="true" Text="Size" Enable="false"/>
philpem@1 57 <Parm Name="WB_DAT_WIDTH" Port="GPIO" Type="List" ListValues="8,32" OType="Integer" Value="32" Text="WISHBONE Data Bus Width" isparm="true"/>
philpem@1 58 <Parm Name="WB_ADR_WIDTH" Port="GPIO" Type="Integer" OType="Integer" Value="4" Text="WISHBONE Address Bus Width" isparm="true"/>
philpem@0 59 <Parm Name="ADDRESS_LOCK" Type="Define" Value="undef" Text="Lock Address"/>
philpem@0 60 <Parm Name="DISABLE" Type="Define" Value="undef" isuse="true" Text="Disable Component"/>
philpem@0 61 <Parm Name="OUTPUT_PORTS_ONLY" Type="define" Value="def" GROUP="XFER_MODE" Text="Output Ports Only" isparm="true" />
philpem@0 62 <Parm Name="INPUT_PORTS_ONLY" Type="define" Value="undef" GROUP="XFER_MODE" Text="Input Ports Only" isparm="true"/>
philpem@0 63 <Parm Name="TRISTATE_PORTS" Type="define" Value="undef" GROUP="XFER_MODE" Text="Tristate Ports" isparm="true"/>
philpem@0 64 <Parm Name="BOTH_INPUT_AND_OUTPUT" Type="define" Value="undef" GROUP="XFER_MODE" Text="Both Input and Output" isparm="true"/>
philpem@0 65 <Parm Name="DATA_WIDTH" Type="Integer" ValueRange="1-32" Value="1" NotCondition="BOTH_INPUT_AND_OUTPUT" Text="Data Width" isparm="true"/>
philpem@0 66 <Parm Name="INPUT_WIDTH" Type="Integer" ValueRange="1-32" Value="1" Condition="BOTH_INPUT_AND_OUTPUT" Text="Input Width" isparm="true"/>
philpem@0 67 <Parm Name="OUTPUT_WIDTH" Type="Integer" ValueRange="1-32" Value="1" Condition="BOTH_INPUT_AND_OUTPUT" Text="Output Width" isparm="true"/>
philpem@0 68 <Parm Name="IRQ_MODE" Type="define" Value="undef" Text="IRQ Mode" isparm="true"/>
philpem@1 69 <Parm Name="LEVEL" Type="define" Value="undef" GROUP="IMODE" Condition="IRQ_MODE" Text="Level Sensitive" isparm="true"/>
philpem@1 70 <Parm Name="EDGE" Type="define" Value="def" GROUP="IMODE" Condition="IRQ_MODE" Text="Edge Sensitive" isparm="true"/>
philpem@0 71 <Parm Name="EITHER_EDGE_IRQ" Type="define" Value="undef" Group="EMODE" Condition="EDGE" Text="Either Edge" isparm="true"/>
philpem@0 72 <Parm Name="POSE_EDGE_IRQ" Type="define" Value="def" Group="EMODE" Condition="EDGE" Text="Postive Edge" isparm="true"/>
philpem@0 73 <Parm Name="NEGE_EDGE_IRQ" Type="define" Value="undef" Group="EMODE" Condition="EDGE" Text="Negative Edge" isparm="true"/>
philpem@0 74 </Parms>
philpem@0 75 <GUIS Columns="2" Help="component_help\lm32.htm" Name="GPIO">
philpem@0 76 <GUI Widget="Text" Span="1" Name="InstanceName" Width="40"/>
philpem@0 77 <GUI Widget="Text" Span="1" Name="BASE_ADDRESS"/>
philpem@1 78
philpem@1 79 <GUI Widget="Group" Span="1" Name="XFER_MODE" Text="Port Types" Columns="1"/>
philpem@0 80 <GUI Widget="Radio" Span="1" Name="OUTPUT_PORTS_ONLY"/>
philpem@0 81 <GUI Widget="Radio" Span="1" Name="INPUT_PORTS_ONLY"/>
philpem@0 82 <GUI Widget="Radio" Span="1" Name="TRISTATE_PORTS"/>
philpem@0 83 <GUI Widget="Radio" Span="1" Name="BOTH_INPUT_AND_OUTPUT"/>
philpem@1 84
philpem@1 85 <GUI Widget="Group" Span="1" Text="Input/Output Port Widths" Columns="2"/>
philpem@0 86 <GUI Widget="Spinner" Span="1" Name="DATA_WIDTH"/>
philpem@0 87 <GUI Widget="Spinner" Span="1" Name="INPUT_WIDTH"/>
philpem@0 88 <GUI Widget="Spinner" Span="1" Name="OUTPUT_WIDTH"/>
philpem@1 89
philpem@1 90 <GUI Widget="Group" Span="2" Name="IRQ_MODE" Text="IRQ Mode" Columns="3"/>
philpem@0 91 <GUI Widget="Check" Span="1" Name="IRQ_MODE"/>
philpem@0 92 <GUI Widget="Radio" Span="1" Name="LEVEL"/>
philpem@0 93 <GUI Widget="Radio" Span="1" Name="EDGE"/>
philpem@1 94
philpem@1 95 <GUI Widget="Group" Span="2" Text="Edge Response" Columns="3"/>
philpem@0 96 <GUI Widget="Radio" Span="1" Name="EITHER_EDGE_IRQ"/>
philpem@0 97 <GUI Widget="Radio" Span="1" Name="POSE_EDGE_IRQ"/>
philpem@0 98 <GUI Widget="Radio" Span="1" Name="NEGE_EDGE_IRQ"/>
philpem@1 99
philpem@1 100 <GUI Widget="Group" Span="2" Text="WISHBONE Configuration" Columns="2"/>
philpem@1 101 <GUI Widget="Combo" Span="1" Name="WB_DAT_WIDTH" Port="GPIO"/>
philpem@0 102 </GUIS>
philpem@0 103 </Component>