Situation:
In a particular research process, we encountered a situation that hundreds of power domain and switches. It is almost impossible to handle it manually. An automation design flow is needed to handle them. Therefore we developed an automatic process to generate UPF from SystemVerilog RTL using VCS.
Design Flow Output:
A fully functional UPF Description. It works as a single level single source power architecture with multiple power controller supported.
REMARK:
The current script only support Synopsys EDA Tools. For Cadence user...... I can't help you.
The script is not published at current state and will be used on a undergoing research.
CUHK ASIC Lab Members who wish to adopt the Auto UPF flow, please contact me through my mail or find me directly.
>Office: SHB 217
>Mail: khwong _ ee _ cuhk
Process
1. Define power controller in RTL
A power controller will assert a string at the beginning of simulation.
This define the name of the controller, the power domains under its control, enabled low-power features (isolation,retention, level shifting), name of the control signals and related setting.
The behavior of the controller is described as standard RTL.
The assertion is in CSV format.
We can define multiple power controllers by giving unique name to the power controllers.
Example Assertion:
// synopsys translate_off
initial begin
$display("PWR,CTRL,%s,%m,%1d,%1d,%1d,%s,%s,%s",PDControllerName......);
end
// synopsys translate_on
Example Output:
PWR,CTRL,Buf_1_1_0,tb.inBuf.pwrCtrl,0,1,0,powerUp,high,powerUp,low,1,powerUp,powerUp,none,none
PWR,CTRL,Buf_1_2_1,tb.inBuf.pwrCtrl,0,1,0,powerUp,high,powerUp,low,1,powerUp,powerUp,none,none
2. Define assertion for units under control
Each unit under controller by a power controller will be given a power domain.
Those instance will assert a CSV line that includes the name of the power controller and which bit of the control signal will be used. (Control signals from the controller is a bit vector)
Example Assertion:
// synopsys translate_off
initial begin
$display("PWR,PD,%s,%m,1d",PDControllerName,PDControlIndex);
end
// synopsys translate_on
Example Output:
PWR,PD,Buf_1_1_0,tb.inBuf.bufferArray[0].bufferUnit,0
PWR,PD,Buf_1_1_0,tb.inBuf.bufferArray[1].bufferUnit,1
PWR,PD,Buf_1_1_0,tb.inBuf.bufferArray[2].bufferUnit,2
PWR,PD,Buf_1_1_0,tb.inBuf.bufferArray[3].bufferUnit,3
PWR,PD,Buf_1_1_0,tb.inBuf.bufferArray[4].bufferUnit,4
PWR,PD,Buf_1_1_0,tb.inBuf.bufferArray[5].bufferUnit,5
3. Simulate the design
We have the simulate the design to obtain all the assertions from the RTL. This can be done easily by:
> vcs -full64 -sverilog src/*.sv | grep ^PWR > PWR.txt
We can obtain all Power related assertion by "grep"
Example Output:
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[0].processorUnit,0
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[1].processorUnit,1
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[2].processorUnit,2
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[3].processorUnit,3
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[4].processorUnit,4
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[5].processorUnit,5
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[6].processorUnit,6
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[7].processorUnit,7
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[8].processorUnit,8
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[9].processorUnit,9
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[10].processorUnit,10
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[11].processorUnit,11
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[12].processorUnit,12
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[13].processorUnit,13
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[14].processorUnit,14
PWR,PD,CPU_1_1_0,tb.inCPU.processorArray[15].processorUnit,15
PWR,CTRL,CPU_1_1_0,tb.inCPU.pwrCtrl,0,1,0,powerUp,high,powerUp,low,1,powerUp,powerUp,none,none
In this example, we have 1 power controller and 16 instances under its control.
4. Translate the result into UPF
Afterwards, assertion records can be translated with "csvtool" and our script.
5. Compile Power State Table (PST)
The script will generate a PST template includes all possible power state combinations.
However, the default table might be much larger than enough and exhaust the system.
In this example, we have 65536 possible combinations but we only need 242 of them.
We have to modify those PST and compile them into UPF separately.
6. (Verification) Locate the top design instance uses the UPF.
This can be done by adding [set_design_top "testBench/topInstance"] at the beginning of the UPF.
7. Adding Power Instruction to your test bench.
Adding the following to your test bench:
module tb();
import UPF::*;
initial begin
supply_on("VDD",1.05);
supply_on("VSS",0.0);
//Other power control commands if needed
#300 supply_off("VDD");
end
...
8. Run VCS with UPF
After merging all UPF as one, we can recompile the SystemVerilog RTL with UPF Specification.
> vcs -full64 -sverilog -upf top.upf src/*.sv
The result of our run is as follow:
2014年8月26日 星期二
2014年7月9日 星期三
[Xilinx] Booting Petalinux on Zynq through JTAG+TFTP, w/o an SD Card
Hi all,
I am quite new to Zynq System and spend a few days to port a working Linux on the chip. Xilinx provides both XSDK for baremetal developments and petalinux for linux deployment. Personally I hate keep plugging the SD for every single time especially when I deal with linux development.
However, The "petalinux-boot" utility always fail to boot a working linux or we can't even transfer the image to the DRAM. I would like to make all the stuff done with JTAG,LAN and standard tools like XMD. I would like to share the solution I have realized after a few days of struggling. Hope this helps your development.
We assume:
1. You have finished the "petalinux-create" for a petalinux file system.
2. You have configured the system through "petalinux-config"
3. You have finished the compilation of your system through "petalinux-build".
If you failed to build the rootfs, please try to run the build for TWICE MORE. It works.
4. You have exported your hardware and they can be accessed by XSDK.
You will have the following files in "<PetaLinux Dir>/images/linux"
1. image.ub > Kernel Image for u-boot
2. urootfs.cpio.gz > RootFS for linux in u-boot format
3. system.dtb > Device Tree Blob
They should be also located in "/tftpboot". They should be identical.
You will need two more files for the setup.
1. The bit stream of your PL/FPGA Design
You can find them through [find . -name "*.bit"]
2. The TCL Script to initialize the PS/ARM.
It is located at the "someDesign.sdk/hardware platform" under your Vivado project folder.
You can find them through [find . -name "*ps7_init.tcl"].
Copy these files to the "<PetaLinux Dir>/images/linux" is recommended.
After that, you can use XMD to boot the system. You also need an UART connection to your FPGA.
Steps:
1. > xmd
2. xmd> source ps7_init.tcl
3. xmd> connect arm hw
5. xmd> ps7_init
6. xmd> ps7_post_conf
7. xmd> dow u-boot.elf
8. xmd> run
9. xmd> fpga -f bitstream.bit
Step 5 and 6 enable the DDR-RAM PLL for DDR-RAM access. And these routine is located in the "ps7_init.tcl" mentioned.
Step 7 and 8 launch u-boot through JTAG.
Connecting the UART through a terminal application (e.g. Putty) and stop the auto boot process.
Step 9 downloads the bitstream to the FPGA. Without this, the kernel might stuck because it can't find the custom device through AXI ports and fail the process.
9. uboot> tftpboot 0x1000000 /tftpboot/image.ub
10. uboot> tftpboot 0x2000000 /tftpboot/urootfs.cpio.gz
11. uboot> tftpboot 0x3000000 /tftpboot/system.dtb
12. uboot> bootm 0x1000000 0x2000000 0x3000000
Step 9-11 load all the kernel related files to the DDR-RAM through tftp and bootm will start the boot.
The addresses (0x1,2,3000000) can be adjusted according to the file size.
The linux should be ready for access.
As a final remark, you might have to modify:
1. "bootargs" to boot the kernel. Most likely the ip should be included. For static IP setting, you will need: ip=DeviceIP:ServerIP:NetMask:GatewayIP:HostName:InterfaceName
It can be used during the boot process but you still need to modify "/etc/network/interfaces"
2. "tftpboot" needs a device IP and also the server IP. Make sure you have set the correct IP setting in uboot env. Furthermore, TFTP runs in UDP and no gateway is needed. You might check if the tftp server listens the correct port through: ">netstat -nulp"
Now, you can deploy your system without using SD Card. This allows me to perform remote development even I am working somewhere else. Hope you enjoy the development.
2014年5月6日 星期二
Android Smart phone Unlock Bootloader, root and flash rom
I would like to write down my experience of unlock bootloader, root and flash the rom for my sony xperia U and my understanding in a matter of kernal, tools and so on.
Before this, I would like to list out all the useful links which help me to finish the tasks.
However, time is limited, I would like to finish it tomorrow morning within 1 hour. Thank you.
http://forum.xda-developers.com/xperia-u/issues/xperia-bricked-unable-enter-neither-t2482179
http://en.kioskea.net/faq/3914-windows-7-disable-signature-verification-of-drivers
http://social.technet.microsoft.com/Forums/windows/en-US/9b6eee60-855d-47cc-9927-acae3fb6f971/permanently-disable-driver-signature-enforcement-on-win-7-x64?forum=w7itprohardware
http://www.youtube.com/watch?v=RPp0PN3FkWY
Before this, I would like to list out all the useful links which help me to finish the tasks.
However, time is limited, I would like to finish it tomorrow morning within 1 hour. Thank you.
http://forum.xda-developers.com/xperia-u/issues/xperia-bricked-unable-enter-neither-t2482179
http://en.kioskea.net/faq/3914-windows-7-disable-signature-verification-of-drivers
http://social.technet.microsoft.com/Forums/windows/en-US/9b6eee60-855d-47cc-9927-acae3fb6f971/permanently-disable-driver-signature-enforcement-on-win-7-x64?forum=w7itprohardware
http://www.youtube.com/watch?v=RPp0PN3FkWY
Xilinx Vivado VCS simulation Export
Get into TCL Console
1. cd to a test space first
2. compile_simlib -directory "somehwere" {-family/library} {-language} -simulator vcs_mx
3. Generate Block design first
4. Export for Simulations
export_simulation -lib_map_path "lib" -directory "output" -simulator vcs_mx
-of_objects [get_ips / get_files]
5. Modify the simulation script generated. It should include the source files locations.
1. cd to a test space first
2. compile_simlib -directory "somehwere" {-family/library} {-language} -simulator vcs_mx
3. Generate Block design first
4. Export for Simulations
export_simulation -lib_map_path "lib" -directory "output" -simulator vcs_mx
-of_objects [get_ips / get_files]
5. Modify the simulation script generated. It should include the source files locations.
訂閱:
文章 (Atom)