DUSD(Labs)
Cypress Semiconductor’sCypress Semiconductor’sProgrammable SystemProgrammable System--onon--aa--Chip (Chip (PSoCPSoC))OverviewOverview
Doug Densmore Doug Densmore –– UC BerkeleyUC BerkeleyBarbara Barbara SchrempSchremp, Michael , Michael LaBouffLaBouff, Sanjay , Sanjay RekhiRekhiCypress SemiconductorCypress SemiconductorNovember 20, 2002November 20, 2002
OutlineOutline
uuCSA MotivationsCSA Motivations
uuPSoCPSoC BackgroundBackground
uuOverviewOverview
ss Hardware and ApplicationsHardware and Applications
uuSystem DetailsSystem Details
uuProgramming ModelProgramming Model
uuCSA QuestionsCSA Questions
uuConclusions and Future WorkConclusions and Future Work
CSA Motivation CSA Motivation
uuWe have been examining architectures and applications to We have been examining architectures and applications to
gain insight into programming environments for gain insight into programming environments for
Concurrent Systems Architectures.Concurrent Systems Architectures.
uuWe have looked primarily at high performance products We have looked primarily at high performance products
with specific application areas. with specific application areas.
uuCypress’ Cypress’ PSoCPSoC is aimed at the low end, embedded is aimed at the low end, embedded
microcontroller market.microcontroller market.
ss Cost ($2Cost ($2--3.50*) per device; Free software updates3.50*) per device; Free software updates
* http://www.ebnonline.com
CSA MotivationCSA Motivation
Architecture OverviewArchitecture OverviewReconfigurable MicrocontrollerReconfigurable MicrocontrollerCypress Cypress PSoCPSoC
Architecture OverviewArchitecture OverviewTiled architectureTiled architectureRAWRAW
Architecture OverviewArchitecture OverviewCell architectureCell architectureiWarpiWarp
Mixed Version IP RouterMixed Version IP RouterPower PC + FPGAPower PC + FPGAVirtexVirtex--II ProII Pro
Architecture OverviewArchitecture OverviewGatewayGateway--onon--aa--ChipChipBroadcomBroadcom CalistoCalisto
Architecture AbstractionArchitecture AbstractionNetwork ProcessorNetwork ProcessorIntel IXP1200Intel IXP1200
IPv4 ForwardingIPv4 ForwardingNetwork ProcessorNetwork ProcessorCC--Port C5Port C5
Context PresentedContext PresentedArchitecture TypeArchitecture Type
??Reconfigurable RISCReconfigurable RISCTensilicaTensilica XtensaXtensa
MPEG2 DecodingMPEG2 DecodingMultimedia ProcessorMultimedia ProcessorPhilips Philips NexperiaNexperia
Green – Application Specific; Blue – Generic
CSA MotivationCSA Motivation
uuExamine what is exposed to the programmer via both the Examine what is exposed to the programmer via both the
GUI provided for reconfiguring the part and the GUI provided for reconfiguring the part and the
interconnect, and the software environment for interconnect, and the software environment for
programming it.programming it.
uuIdentify the primitive components and identify their Identify the primitive components and identify their
interaction.interaction.
uuExamine the mindset of someone working with the Examine the mindset of someone working with the PSoCPSoC
and their design process.and their design process.
BackgroundBackground
uuDeveloped by Cypress Microsystems, a subsidiary of Developed by Cypress Microsystems, a subsidiary of Cypress Semiconductor. Acquired March 6Cypress Semiconductor. Acquired March 6thth, 2000., 2000.
uuPSoCPSoC Released November 13, 2000 Released November 13, 2000 ss “As general purpose solutions, “As general purpose solutions, PSoCPSoC devices are targeted for devices are targeted for
implementation in embedded applications, including audio, implementation in embedded applications, including audio, wireless, handheld, data communications, Internet control, wireless, handheld, data communications, Internet control, industrial, and consumer systems. “industrial, and consumer systems. “
uuNamed Innovation of the Year 2001 by EDN Magazine.Named Innovation of the Year 2001 by EDN Magazine.
uuBerkeley provided with a Berkeley provided with a PSoCPSoC development kit as member development kit as member of GSRC.of GSRC.
http://www.cypressmicro.com
Hardware OverviewHardware Overview
uuHarvard Architecture ProcessorHarvard Architecture Processorss M8C; Up to 24MHz; Flexible Addressing modesM8C; Up to 24MHz; Flexible Addressing modes
ss Separate MAC; 8x8 multiply, 32 bit accumulateSeparate MAC; 8x8 multiply, 32 bit accumulate
uuOn Chip MemoryOn Chip Memoryss Flash 4k to 16k Flash 4k to 16k -- SONOS™SONOS™--based (Silicon Oxide Nitride Oxide Silicon) based (Silicon Oxide Nitride Oxide Silicon)
ss 256 Bytes SRAM256 Bytes SRAM
ss EEPROM Emulation in FlashEEPROM Emulation in Flash
uuProgrammable System on a Chip BlocksProgrammable System on a Chip Blocksss 12 Analog Blocks12 Analog Blocks
ss 8 Digital Blocks8 Digital Blocks
Hardware OverviewHardware Overview
uuProgrammable Pin ConfigurationsProgrammable Pin Configurations
ss Interrupt on pin changeInterrupt on pin change
uuPrecision, Programmable ClockingPrecision, Programmable Clocking
ss External 32kHZ clockExternal 32kHZ clock
uuDedicated PeripheralsDedicated Peripherals
ss Watchdog and Sleep TimersWatchdog and Sleep Timers
ss Low Voltage DetectionLow Voltage Detection
ss OnOn--Chip voltage referencesChip voltage references
uu“Complete” Software Development tools“Complete” Software Development tools
Application Space OverviewApplication Space Overview
uuCompany Line*Company Line*
ss ““PSoCPSoC™ Devices Integrate Programmable Analog and Digital ™ Devices Integrate Programmable Analog and Digital Functions To Simplify Design Of Wireless, Handheld, Data Functions To Simplify Design Of Wireless, Handheld, Data Communications, and Industrial Systems”Communications, and Industrial Systems”
uuSample Application NotesSample Application Notes
ss Range Finder Range Finder
ss 11--GHz GHz VectorialVectorial Network Analyzer Network Analyzer
ss Remote Human Health Monitoring SystemRemote Human Health Monitoring System
uuDynamic reconfiguration is a key application point.Dynamic reconfiguration is a key application point.
http://www.cypressmicro.com
System OverviewSystem Overview
uuKeys to note:Keys to note:ss Programmable interconnectProgrammable interconnect
ss Digital Digital PSoCPSoC BlocksBlocks
ss Analog Analog PSoCPSoC BlocksBlocks
ss Separate MACSeparate MAC
ss Static PeripheralsStatic Peripheralstt LVD, Decimator, etcLVD, Decimator, etc
uuExposed to Programmer Exposed to Programmer through “Module Placement through “Module Placement view”view”
uuExposed to Programmer Exposed to Programmer through “Application View”through “Application View”
http://www.cypressmicro.com
Device Family FeaturesDevice Family Features
YesYesYesYesYesYesNoNoExternalExternal SMPSMP
48 PDIP48 PDIP
48 SSOP48 SSOP
44 TQFP44 TQFP
28 PDIP28 PDIP
28 SOIC28 SOIC
28 SSOP28 SSOP
20 PDIP20 PDIP
20 SOIC20 SOIC
20 SSOP20 SSOP
8 PDIP8 PDIPAvailable PackagesAvailable Packages
40/4440/442424161666I/O PinsI/O Pins
1212121212121212Analog PSOC BlocksAnalog PSOC Blocks
88888888Digital PSOC BlocksDigital PSOC Blocks
256256256256256256256256Data Memory (Bytes)Data Memory (Bytes)
161616168844Program Memory (KB)Program Memory (KB)
3.03.0--5.25V5.25V3.03.0--5.25V5.25V3.03.0--5.25V5.25V3.03.0--5.25V5.25VOperating VoltageOperating Voltage
93.7kHz93.7kHz--24MHZ24MHZ93.7kHz93.7kHz--24MHZ24MHZ93.7kHz93.7kHz--24MHZ24MHZ93.7kHz93.7kHz--24MHZ24MHZOperating FrequencyOperating Frequency
CY8C26643CY8C26643CY8C26443*CY8C26443*CY8C26233CY8C26233CY8C25122CY8C25122
*Have in Embedded Systems Lab
http://www.cypressmicro.com
Development Kit ($147)Development Kit ($147)
uuInIn--CircuitCircuit--Emulator (ICE)Emulator (ICE)ss Provides debugging capabilities.Provides debugging capabilities.
uuYY--ProgrammerProgrammerss Download configurations and Download configurations and
code to device; code to device; supports DIP supports DIP packagespackages..
uuPOD, Pup, and FootPOD, Pup, and Footss Bar LED and DIP Foot, POD rev EBar LED and DIP Foot, POD rev E
uuSamplesSamplesss 2 CY8C264432 CY8C26443
uuDevelopment Software Development Software ss Version 3.20 latest; Version 3.20 latest; have 3.10have 3.10
Development Kit
Orlin Technology’s OTPSoC; Not included
Red is in embedded Systems Lab
M8C CPUM8C CPU
uu88--bit, Harvard Architecture Microprocessorbit, Harvard Architecture Microprocessor
uuFive Hardware RegistersFive Hardware Registers
ss Flags (F) Flags (F) –– 3 Status Bits, Global Interrupt Bit, XIO (3 Status Bits, Global Interrupt Bit, XIO (regreg bank bank switch)switch)
ss Program Counter (PC)Program Counter (PC)–– 16 bit; Full addressing of the 16K FLASH16 bit; Full addressing of the 16K FLASH
ss Accumulator (A)Accumulator (A)
ss Stack Pointer (SP)Stack Pointer (SP)
ss Index (X) Index (X) –– Used in addressing Modes; Often used by peripheralsUsed in addressing Modes; Often used by peripherals
CPUProgram
MemDataMem
M8C Addressing ModesM8C Addressing Modes
uu 10 Addressing Modes10 Addressing Modesss Source Immediate Source Immediate –– ADD A, 7ADD A, 7
ss Source Direct Source Direct –– ADD A, [7]ADD A, [7]
ss Source Indexed Source Indexed –– ADD A, [X+7]ADD A, [X+7]
ss Destination Direct Destination Direct -- ADD [7], AADD [7], A
ss Destination Indexed Destination Indexed –– ADD [X+7], AADD [X+7], A
ss Destination Direct Source Immediate Destination Direct Source Immediate –– ADD [7], 5ADD [7], 5
ss Destination Indexed Source Immediate Destination Indexed Source Immediate –– ADD [X+7], 5ADD [X+7], 5
ss Destination Direct Source Direct Destination Direct Source Direct –– ADD [7], [5]ADD [7], [5]
ss Source Indirect Post Increment Source Indirect Post Increment –– MVI A,[7]MVI A,[7]
ss Destination Indirect Post Increment Destination Indirect Post Increment -- MVI [7], AMVI [7], A
M8C Instruction SetM8C Instruction Set
uuSupports a total of 256 instructionsSupports a total of 256 instructionsss Divided into 37 instruction typesDivided into 37 instruction types
uu Instructions take from 4 (ADD A, Instructions take from 4 (ADD A, exprexpr) to 15 (SSC) cycles.) to 15 (SSC) cycles.
uu 11--3 Byte instructions3 Byte instructionsss 2 are the most prevalent, followed by 3 and then 12 are the most prevalent, followed by 3 and then 1
uu 7 instruction formats7 instruction formats
uuNotable instructionsNotable instructionsss System Supervisor Call (SSC), INDEX (Relative Table Read; System Supervisor Call (SSC), INDEX (Relative Table Read;
Moves ROM into RAM; 13 cycles)Moves ROM into RAM; 13 cycles)
Digital BlocksDigital Blocks
uuTotal of 8, 8Total of 8, 8--bit digital blocksbit digital blocksss Four Digital Basic Type A (DBA) and four Digital Communications Four Digital Basic Type A (DBA) and four Digital Communications
Type A (DCA)Type A (DCA)
ss Each can be configured independently or in combinationEach can be configured independently or in combination
ss Each have a unique Interrupt Vector and Interrupt Enable bitEach have a unique Interrupt Vector and Interrupt Enable bit
uuThree Configuration Registers to programThree Configuration Registers to programss Function Register Function Register –– function and modefunction and modett Timer, Counter, CRC/PRS, Timer, Counter, CRC/PRS, DeadbandDeadband (for PWM), UART, Serial Peripheral (for PWM), UART, Serial Peripheral
Interface (SPI)Interface (SPI)
ss Input Register Input Register –– data input and clock selectiondata input and clock selection
ss Output Register Output Register –– select and enable outputsselect and enable outputs
Digital BlocksDigital Blocks
uuThree Data RegistersThree Data Registers
ss Data0, Data1, Data2 Data0, Data1, Data2 –– function dependentfunction dependent
uuOne Control RegisterOne Control Register
uuSample RegisterSample Register
uuExposed in the “Module Placement View “Exposed in the “Module Placement View “
http://www.cypressmicro.com
Analog BlocksAnalog Blocks
uu12 analog blocks12 analog blocks
ss 4 Continuous Time Blocks, 4 Type A Switched Capacitor, and 4 4 Continuous Time Blocks, 4 Type A Switched Capacitor, and 4 Type B Switched CapacitorType B Switched Capacitor
uuThree Distinct outputs from each analog blockThree Distinct outputs from each analog block
ss The analog output bus (ABUS) shared by all blocks in analog The analog output bus (ABUS) shared by all blocks in analog column.column.
ss The comparator bus (CBUS) which is a digital resource shared by The comparator bus (CBUS) which is a digital resource shared by all blocks in a column.all blocks in a column.
ss The output bus (Out) which is shared by all blocks in the columnThe output bus (Out) which is shared by all blocks in the columnand can be reconfigured to send a signal externally.and can be reconfigured to send a signal externally.
Analog BlocksAnalog Blocks
uuAnalog Block RegistersAnalog Block Registers
ss Analog Column Clock Select RegisterAnalog Column Clock Select Register
ss Analog Reference Control RegisterAnalog Reference Control Register
ss Analog Clock Select RegisterAnalog Clock Select Register
ss Control0, Control1, Control2 Registers (Control3 for Control0, Control1, Control2 Registers (Control3 for SwCapSwCap BlksBlks))
uuExposed in the “Module Placement View “Exposed in the “Module Placement View “
User ModulesUser Modules
uuUser modules are what the User modules are what the
programmer really sees when programmer really sees when
configuring the device.configuring the device.
uuCould be considered a primitive Could be considered a primitive
component along with the M8C component along with the M8C
and static peripherals.and static peripherals.
uuCurrent User Modules (sample Current User Modules (sample
in table).in table).
uuNew modules in software New modules in software
updates.updates.115 Flash115 Flash2D2D1616--bit PWMbit PWM
29 Flash29 Flash2A 2A SwCpSwCpTwo Pole Band Two Pole Band
Pass FilterPass Filter
56 Flash56 Flash2D2D1616--bit CRCbit CRC
47 Flash47 Flash1A 1A SwCpSwCp66--Bit DACBit DAC
66 Flash66 Flash1D1D88--bit Counterbit Counter
32 Flash32 Flash1A CT 1A CT Programmable Programmable
Gain AmpGain Amp
184 Flash184 Flash
6 SRAM6 SRAM
2D, 1A2D, 1A1212--Bit ADCBit ADC
Memory Memory
(Bytes)(Bytes)PSoCPSoC BlocksBlocks
Programming ModelProgramming Model
uuWindows based graphical programming environment both Windows based graphical programming environment both
for the configuration of the reconfigurable blocks and for the configuration of the reconfigurable blocks and
interconnect, as well as the development of the software.interconnect, as well as the development of the software.
uuMultiple Editors (“Views”)Multiple Editors (“Views”)
ss Device EditorDevice Editor
ss Application EditorApplication Editor
ss DebuggerDebugger
Device EditorDevice Editor
uuUser Module Selection View User Module Selection View –– select amongst the provided select amongst the provided
user modules. View datasheet and schematic information user modules. View datasheet and schematic information
as well as the status of global resources (RAM, ROM, as well as the status of global resources (RAM, ROM,
Reconfigurable Blocks).Reconfigurable Blocks).
uuModule Placement View Module Placement View –– assign the user modules to assign the user modules to
reconfigurable blocks. Configure the interconnect between reconfigurable blocks. Configure the interconnect between
modules and the module parameters.modules and the module parameters.
uuPinoutPinout View View ––the the pinoutpinout of the package selected. Assign of the package selected. Assign
global buses to pins and activate interrupts on pins.global buses to pins and activate interrupts on pins.
Application EditorApplication Editor
uuOnce you “Generate an Application”, assembly code Once you “Generate an Application”, assembly code
libraries are generated which provide the functionality for libraries are generated which provide the functionality for
the user modules you have selected.the user modules you have selected.
uuThis view allows you to modify the “main” program as well This view allows you to modify the “main” program as well
as the interrupt routine you wish so that you can program as the interrupt routine you wish so that you can program
the device.the device.
uuDone in assembly or C (C compiler sold separately; $145).Done in assembly or C (C compiler sold separately; $145).
DebuggerDebugger
uuTypical debugger in which you can set breakpoints, Typical debugger in which you can set breakpoints,
observe variables, monitor global resources (RAM, ROM, observe variables, monitor global resources (RAM, ROM,
Registers), and observe which configuration you are in.Registers), and observe which configuration you are in.
uuConnect to the ICE (through parallel port EPP mode).Connect to the ICE (through parallel port EPP mode).
uuDownload configurations and code to the part.Download configurations and code to the part.
Dynamic ReconfigurationDynamic Reconfiguration
uuIn the Module Selection view, you can import (or export) In the Module Selection view, you can import (or export) configurations.configurations.
uuConfigurations consist of user modules, their Configurations consist of user modules, their interconnections, and their parameters.interconnections, and their parameters.
uuThen at runtime you can swap to another configuration viaThen at runtime you can swap to another configuration viacall call UnloadConfig_newled_projUnloadConfig_newled_proj
call call LoadConfig_dynamic_improvedLoadConfig_dynamic_improved
uu This amounts to swapping out and reloading of the This amounts to swapping out and reloading of the PSoCPSoC block block registers mentioned earlier.registers mentioned earlier.ss Stores the configurations in FLASHStores the configurations in FLASH
ss 100+ cycles (best guess)100+ cycles (best guess)
Exporting Features to the ProgrammerExporting Features to the Programmer
uuUser Modules, Interconnect, Pin Assignment, M8C ISA, User Modules, Interconnect, Pin Assignment, M8C ISA, Select Global Resources directly available through GUI.Select Global Resources directly available through GUI.ss Define the topology of the chip Define the topology of the chip
uuPSoCPSoC Register Space can be accessed via individual Register Space can be accessed via individual programming.programming.ss With understanding of With understanding of PSoCPSoC analog blocks you can create new analog blocks you can create new
“user modules” or modify existing ones.“user modules” or modify existing ones.
uuAssembly gives you “lowest level access” to the Assembly gives you “lowest level access” to the programming of M8Cprogramming of M8Css Have not used the C ComplierHave not used the C Complier
Programmer’s Thought ProcessProgrammer’s Thought Process
uuNeed to identify what user modules are required for a particularNeed to identify what user modules are required for a particularapplication.application.ss There are certain modules which an application requires by defauThere are certain modules which an application requires by default.lt.
uuPeripherals that need to directly interact should be in the samePeripherals that need to directly interact should be in the sameconfiguration.configuration.ss Must meet Must meet PSoCPSoC block constraintsblock constraints
uuGenerate configuration and use the provided APIs to program the Generate configuration and use the provided APIs to program the application.application.
uuProgramming the applicationProgramming the applicationss Can use the resources to model the application as you chooseCan use the resources to model the application as you choosess C or M8C AssemblyC or M8C Assembly
uuProgram the part; test; iterateProgram the part; test; iterate
CSA Model Support ExamplesCSA Model Support Examples
uuPipe and FilterPipe and Filter
ss Peripherals (Filters); Reconfigurable Interconnect (Pipe)Peripherals (Filters); Reconfigurable Interconnect (Pipe)
ss Can chain peripherals togetherCan chain peripherals together
uuProcess Control SystemsProcess Control Systems
ss Provide dynamic control from some plantProvide dynamic control from some plant
ss Inputs received by peripherals, State in memory, Output via Inputs received by peripherals, State in memory, Output via peripheralsperipherals
Exploiting Features of Hardware Exploiting Features of Hardware
uuRequires you to completely define the relationships Requires you to completely define the relationships
between the user modules yourself.between the user modules yourself.
ss As opposed to having some tool help you optimize this in As opposed to having some tool help you optimize this in someway.someway.
ss In contrast to RAW in which the compiler utilizes the hardware In contrast to RAW in which the compiler utilizes the hardware efficiently.efficiently.
uuLibrary Routines automatically provided for software Library Routines automatically provided for software
programming.programming.
Component InteractionComponent Interaction
uuLimited by which Limited by which PSoCPSoC blocks the modules are placed on.blocks the modules are placed on.
ss May not have run out of blocks yet not be able to realize a May not have run out of blocks yet not be able to realize a particular connection.particular connection.
uuDepending on the modules, they may communicate Depending on the modules, they may communicate
through memory, pins, buses, or M8C register space.through memory, pins, buses, or M8C register space.
uuWhile they are able to function on their own, most While they are able to function on their own, most
peripherals require the use of the M8C and interrupts.peripherals require the use of the M8C and interrupts.
PSoCPSoC StrengthsStrengths
uuVery Easy to configure both the reconfigurable blocks and Very Easy to configure both the reconfigurable blocks and
interconnect.interconnect.
ss GUI provides the programmer quick access to the majority of GUI provides the programmer quick access to the majority of primitives.primitives.
uuTools automatically generate peripheral functions and Tools automatically generate peripheral functions and
configuration macros.configuration macros.
ss Just cut and pasteJust cut and paste
uuMinutes to iterate through the design processMinutes to iterate through the design process
ss Designer limited; not tool chain limitedDesigner limited; not tool chain limited
PSoCPSoC WeaknessesWeaknesses
uuWhile most features are available, if you want finer While most features are available, if you want finer granularity it either is not possible or you must set granularity it either is not possible or you must set registers manually.registers manually.ss Wrong Primitives? Finite (read small) number of possibilities?Wrong Primitives? Finite (read small) number of possibilities?
uuWorking at a very low level of abstractionWorking at a very low level of abstractionss Assembly, interconnectAssembly, interconnect
ss Tools do not really help make design tradeoff decisionsTools do not really help make design tradeoff decisions
uuSmall amount of SRAMSmall amount of SRAM
uuM8C not very powerful; potentially awkwardM8C not very powerful; potentially awkward
PSoCPSoC ConclusionsConclusions
uuPSoCPSoC provides a very flexible way in which to customize a provides a very flexible way in which to customize a
low end embedded microcontroller.low end embedded microcontroller.
uuGives the programmer access to most all reconfigurable Gives the programmer access to most all reconfigurable
feature directly through a GUIfeature directly through a GUI
uuTool generates substantial amount of peripheral code Tool generates substantial amount of peripheral code
automatically.automatically.
uuDevelopment, testing, and implementation time is really a Development, testing, and implementation time is really a
function of the user, not the tool chain.function of the user, not the tool chain.
CSA ConclusionsCSA Conclusions
uuProgramming ModelProgramming Modelss GUI and Automatically generated peripheral routines and GUI and Automatically generated peripheral routines and
configuration calls.configuration calls.
uuProgrammers’ Thought ProcessProgrammers’ Thought Processss Application Application -- User Modules User Modules –– Connection Connection –– Application Code Application Code ––
TestTest
uuExport features either at high level (GUI) or low level (ASM)Export features either at high level (GUI) or low level (ASM)
uuPrimitivesPrimitivesss User modules (perhaps User modules (perhaps PSoCPSoC Blocks), M8C, Memory, Blocks), M8C, Memory,
InterconnectInterconnect
Future WorkFuture Work
uuCurrently creating tools to get performance estimations Currently creating tools to get performance estimations
from the from the PSoCPSoC
ss ACE ACE –– Assembly Code Estimator Assembly Code Estimator –– determines how many cycles determines how many cycles code will require.code will require.
ss PET PET –– Peripheral Estimator Tool Peripheral Estimator Tool –– determines if a particular determines if a particular configuration can be realized on the configuration can be realized on the PSoCPSoC blocks and if so, which blocks and if so, which inputs will be available.inputs will be available.
uuRough Constraints FrameworkRough Constraints Framework
ss Set of inequalities relating hardware resourcesSet of inequalities relating hardware resources