Is the following synthesizable? - verilog

Hi I am trying to create a verilog register that outputs its value only when the write signal is high else it is high impedance. Is the following synthesizable?
module R(data_from_bus,data_to_bus,clk,read,write);
input [7:0]data_from_bus;
input clk,read,write;
output reg[7:0] data_to_bus;
reg[7:0] r_reg;
always#(posedge clk)
begin
if (read==1)
r_reg<=data_from_bus;
end
always#(write)
begin
if (write==1)
data_to_bus=r_reg;
else
data_to_bus=8'bz;
end
endmodule

yes, it is synthesizable, but not necessarily doing what you want because of the questionable format.
here's a better (safer) version:
module R(data_from_bus,data_to_bus,clk,read,write);
input [7:0]data_from_bus;
input clk,read,write;
output data_to_bus;
reg[7:0] r_reg;
always#(posedge clk) begin
if (read)
r_reg<=data_from_bus;
else
r_reg<=r_reg;
end
wire[7:0] r_reg_wire;
assign r_reg_wire = r_reg;
assign data_to_bus = write ? r_reg_wire : 8'bz;
endmodule
the main problem of the one you posted is that you are not having an else statement for the first non-blocking assignment: (if (read == 1))
This might result in inferring a latch (but tools are most likely smart enough to fix it implicitly), which does the same thing in simulation as a flip-flop in simulation, but will mess with timing in real life deployment
a really good approach is to use 'always_ff' for registers assignment, 'always_comb' for combinational logic assignment, and 'always_latch' for intended latch (which is rarely used apart from really fishy timing case such as clock gating); but these keyword are only supported in SystemVerilog

Yes.
Here is the result of synthesizing the posted code in the free online tools available at the EDA Playground website, using Mentor Precision.
Please add r_reg to the sensitivity list for the combinational logic to assure the simulation and synthesis results agree. Use always #(*) to accomplish the same thing using a wildcard style approach.
Synthesis ran and produced no errors.
The log is shown below.
The last part of the log is a post synthesis Verilog netlist.
Note the tool used the FDRE primitive to implement the registers bits.
To repeat this process, see the reference design at:
https://www.edaplayground.com/x/2BmJ
Copy the reference design to your EDA Playground account (assuming you have one;you should its free and helpfu) using the copy button.
Paste the design you want to synthesize into the design.v tab.
Run it by clicking the run button.
Log file
[2022-05-08 23:57:07 UTC] precision -shell -file run.do -fileargs "design.sv" && sed 's-$-<br>-g' precision.v > tmp.html && echo '<!DOCTYPE html> <html> <head> <style> body {font-family: monospace;} </style> </head> <body>' > tmp2.html && echo '</body> </html> ' > tmp3.html && cat tmp2.html tmp.html tmp3.html > precision.html
precision: Setting MGC_HOME to /usr/share/precision/Mgc_home ...
precision: Executing on platform: Derived from Red Hat Enterprise Linux 7.1 (Source) -- 5.4.0-107-generic -- x86_64
// Precision RTL Synthesis 64-bit 2021.1.0.4 (Production Release) Tue Jul 20 01:22:31 PDT 2021
//
// Copyright (c) Mentor Graphics Corporation, 1996-2021, All Rights Reserved.
// Portions copyright 1991-2008 Compuware Corporation
// UNPUBLISHED, LICENSED SOFTWARE.
// CONFIDENTIAL AND PROPRIETARY INFORMATION WHICH IS THE
// PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS
//
// Running on Linux runner#eaa22c631d4a #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 5.4.0-107-generic x86_64
//
// Start time Sun May 8 19:57:09 2022
# -------------------------------------------------
# Info: [9569]: Logging session transcript to file /home/runner/precision.log
# Warning: [9508]: Results directory is not set. Use new_project, open_project, or set_results_dir.
# Info: [9577]: Input directory: /home/runner
# Info: [9572]: Moving session transcript to file /home/runner/precision.log
# Info: [9558]: Created project /home/runner/project_1.psp in folder /home/runner.
# Info: [9531]: Created directory: /home/runner/impl_1.
# Info: [9557]: Created implementation impl_1 in project /home/runner/project_1.psp.
# Info: [9578]: The Results Directory has been set to: /home/runner/impl_1/
# Info: [9569]: Logging project transcript to file /home/runner/impl_1/precision.log
# Info: [9569]: Logging suppressed messages transcript to file /home/runner/impl_1/precision.log.suppressed
# Info: [9552]: Activated implementation impl_1 in project /home/runner/project_1.psp.
# Info: [20026]: MultiProc: Precision will use a maximum of 8 logical processors.
# Info: [15302]: Setting up the design to use synthesis library "xca7.syn"
# Info: [585]: The global max fanout is currently set to 10000 for Xilinx - ARTIX-7.
# Info: [15328]: Setting Part to: "7A100TCSG324".
# Info: [15329]: Setting Process to: "1".
# Info: [7513]: The default input to Vivado place and route has been set to "Verilog".
# Info: [7512]: The place and route tool for current technology is Vivado.
# Info: [3052]: Decompressing file : /usr/share/precision/Mgc_home/pkgs/psr/techlibs/xca7.syn in /home/runner/impl_1/synlib.
# Info: [3022]: Reading file: /home/runner/impl_1/synlib/xca7.syn.
# Info: [645]: Loading library initialization file /usr/share/precision/Mgc_home/pkgs/psr/userware/xilinx_rename.tcl
# Info: [40000]: hdl-analyze, Release RTLC-Precision 2021a.12
# Info: [42003]: Starting analysis of files in library "work"
# Info: [41002]: Analyzing input file "/home/runner/design.sv" ...
# Info: [670]: Top module of the design is set to: R.
# Info: [668]: Current working directory: /home/runner/impl_1.
# Info: [40000]: RTLC-Driver, Release RTLC-Precision 2021a.12
# Info: [40000]: Last compiled on Jul 2 2021 08:23:33
# Info: [44512]: Initializing...
# Info: [44504]: Partitioning design ....
# Info: [40000]: RTLCompiler, Release RTLC-Precision 2021a.12
# Info: [40000]: Last compiled on Jul 2 2021 08:49:53
# Info: [44512]: Initializing...
# Info: [44522]: Root Module R: Pre-processing...
# Info: [44523]: Root Module R: Compiling...
# Warning: [45784]: "/home/runner/design.sv", line 11: Module R, Net(s) r_reg[7:0]: Although this signal is not part of the sensitivity list of this block, it is being read. This may lead to simulation mismatch.
# Info: [44842]: Compilation successfully completed.
# Info: [44856]: Total lines of RTL compiled: 17.
# Info: [44835]: Total CPU time for compilation: 0.0 secs.
# Info: [44513]: Overall running time for compilation: 1.0 secs.
# Info: [668]: Current working directory: /home/runner/impl_1.
# Info: [15334]: Doing rtl optimizations.
# Info: [671]: Finished compiling design.
# Info: [668]: Current working directory: /home/runner/impl_1.
# Info: [20026]: MultiProc: Precision will use a maximum of 8 logical processors.
# Info: [15002]: Optimizing design view:.work.R.INTERFACE
# Info: [15002]: Optimizing design view:.work.R.INTERFACE
# Info: [8010]: Gated clock transformations: Begin...
# Info: [8010]: Gated clock transformations: End...
# Info: [8053]: Added global buffer BUFGP for Port port:clk
# Info: [3027]: Writing file: /home/runner/impl_1/R.edf.
# Info: [3027]: Writing file: /home/runner/impl_1/R.xdc.
# Info: -- Writing file /home/runner/impl_1/R.tcl
# Info: [3027]: Writing file: /home/runner/impl_1/R.v.
# Info: -- Writing file /home/runner/impl_1/R.tcl
# Info: [671]: Finished synthesizing design.
# Info: [11019]: Total CPU time for synthesis: 0.8 s secs.
# Info: [11020]: Overall running time for synthesis: 1.0 s secs.
# Info: /home/runner/impl_1/precision_tech.sdc
# Info: [3027]: Writing file: /home/runner/precision.v.
# Info: [3027]: Writing file: /home/runner/precision.xdc.
# Info: -- Writing file /home/runner/impl_1/R.tcl
# Info: Info, Command 'auto_write' finished successfully
# Info: Num File Type Path
# Info: --------------------------------------------------------
# Info: 0 /home/runner/impl_1/R_area.rep
# Info: 1 /home/runner/impl_1/R_con_rep.sdc
# Info: 2 /home/runner/impl_1/R_tech_con_rep.sdc
# Info: 3 /home/runner/impl_1/R_fsm.rep
# Info: 4 /home/runner/impl_1/R_dsp_modes.rep
# Info: 5 /home/runner/impl_1/R_ram_modes.rep
# Info: 6 /home/runner/impl_1/R_env.htm
# Info: 7 /home/runner/impl_1/R.edf
# Info: 8 /home/runner/impl_1/R.v
# Info: 9 /home/runner/impl_1/R.xdc
# Info: 10 /home/runner/impl_1/R.tcl
# Info: ***************************************************************
# Info: Device Utilization for 7A100TCSG324
# Info: ***************************************************************
# Info: Resource Used Avail Utilization
# Info: ---------------------------------------------------------------
# Info: IOs 19 210 9.05%
# Info: Global Buffers 1 32 3.12%
# Info: LUTs 1 63400 0.00%
# Info: CLB Slices 1 15850 0.01%
# Info: Dffs or Latches 8 126800 0.01%
# Info: Block RAMs 0 135 0.00%
# Info: DSP48E1s 0 240 0.00%
# Info: ---------------------------------------------------------------
# Info: *****************************************************
# Info: Library: work Cell: R View: INTERFACE
# Info: *****************************************************
# Info: Number of ports : 19
# Info: Number of nets : 40
# Info: Number of instances : 29
# Info: Number of references to this view : 0
# Info: Total accumulated area :
# Info: Number of Dffs or Latches : 8
# Info: Number of LUTs : 1
# Info: Number of Primitive LUTs : 1
# Info: Number of accumulated instances : 29
# Info: *****************************
# Info: IO Register Mapping Report
# Info: *****************************
# Info: Design: work.R.INTERFACE
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | Port | Direction | INFF | OUTFF | TRIFF |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_from_bus(7) | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_from_bus(6) | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_from_bus(5) | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_from_bus(4) | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_from_bus(3) | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_from_bus(2) | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_from_bus(1) | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_from_bus(0) | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_to_bus(7) | Output | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_to_bus(6) | Output | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_to_bus(5) | Output | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_to_bus(4) | Output | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_to_bus(3) | Output | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_to_bus(2) | Output | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_to_bus(1) | Output | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | data_to_bus(0) | Output | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | clk | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | read | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: | write | Input | | | |
# Info: +---------------------+-----------+----------+----------+----------+
# Info: Total registers mapped: 0
# Info: [12022]: Design has no timing constraint and no timing information.
# Info: //
# Info: // Verilog description for cell R,
# Info: // Sun May 8 19:57:18 2022
# Info: //
# Info: // Precision RTL Synthesis, 64-bit 2021.1.0.4//
# Info: module R ( data_from_bus, data_to_bus, clk, read, write ) ;
# Info: input [7:0]data_from_bus ;
# Info: output [7:0]data_to_bus ;
# Info: input clk ;
# Info: input read ;
# Info: input write ;
# Info: wire [7:0]data_from_bus_int;
# Info: wire clk_int;
# Info: wire read_int, write_int, nx57998z1, nx198;
# Info: wire [7:0]r_reg;
# Info: OBUFT \data_to_bus_triBus1(0) (.O (data_to_bus[0]), .I (r_reg[0]), .T (
# Info: nx57998z1)) ;
# Info: OBUFT \data_to_bus_triBus1(1) (.O (data_to_bus[1]), .I (r_reg[1]), .T (
# Info: nx57998z1)) ;
# Info: OBUFT \data_to_bus_triBus1(2) (.O (data_to_bus[2]), .I (r_reg[2]), .T (
# Info: nx57998z1)) ;
# Info: OBUFT \data_to_bus_triBus1(3) (.O (data_to_bus[3]), .I (r_reg[3]), .T (
# Info: nx57998z1)) ;
# Info: OBUFT \data_to_bus_triBus1(4) (.O (data_to_bus[4]), .I (r_reg[4]), .T (
# Info: nx57998z1)) ;
# Info: OBUFT \data_to_bus_triBus1(5) (.O (data_to_bus[5]), .I (r_reg[5]), .T (
# Info: nx57998z1)) ;
# Info: OBUFT \data_to_bus_triBus1(6) (.O (data_to_bus[6]), .I (r_reg[6]), .T (
# Info: nx57998z1)) ;
# Info: OBUFT \data_to_bus_triBus1(7) (.O (data_to_bus[7]), .I (r_reg[7]), .T (
# Info: nx57998z1)) ;
# Info: IBUF write_ibuf (.O (write_int), .I (write)) ;
# Info: IBUF read_ibuf (.O (read_int), .I (read)) ;
# Info: IBUF \data_from_bus_ibuf(0) (.O (data_from_bus_int[0]), .I (
# Info: data_from_bus[0])) ;
# Info: IBUF \data_from_bus_ibuf(1) (.O (data_from_bus_int[1]), .I (
# Info: data_from_bus[1])) ;
# Info: IBUF \data_from_bus_ibuf(2) (.O (data_from_bus_int[2]), .I (
# Info: data_from_bus[2])) ;
# Info: IBUF \data_from_bus_ibuf(3) (.O (data_from_bus_int[3]), .I (
# Info: data_from_bus[3])) ;
# Info: IBUF \data_from_bus_ibuf(4) (.O (data_from_bus_int[4]), .I (
# Info: data_from_bus[4])) ;
# Info: IBUF \data_from_bus_ibuf(5) (.O (data_from_bus_int[5]), .I (
# Info: data_from_bus[5])) ;
# Info: IBUF \data_from_bus_ibuf(6) (.O (data_from_bus_int[6]), .I (
# Info: data_from_bus[6])) ;
# Info: IBUF \data_from_bus_ibuf(7) (.O (data_from_bus_int[7]), .I (
# Info: data_from_bus[7])) ;
# Info: INV ix57998z1315 (.O (nx57998z1), .I (write_int)) ;
# Info: BUFGP clk_ibuf (.O (clk_int), .I (clk)) ;
# Info: GND ps_gnd (.G (nx198)) ;
# Info: FDRE \reg_r_reg(7) (.Q (r_reg[7]), .C (clk_int), .CE (read_int), .D (
# Info: data_from_bus_int[7]), .R (nx198)) ;
# Info: FDRE \reg_r_reg(6) (.Q (r_reg[6]), .C (clk_int), .CE (read_int), .D (
# Info: data_from_bus_int[6]), .R (nx198)) ;
# Info: FDRE \reg_r_reg(5) (.Q (r_reg[5]), .C (clk_int), .CE (read_int), .D (
# Info: data_from_bus_int[5]), .R (nx198)) ;
# Info: FDRE \reg_r_reg(4) (.Q (r_reg[4]), .C (clk_int), .CE (read_int), .D (
# Info: data_from_bus_int[4]), .R (nx198)) ;
# Info: FDRE \reg_r_reg(3) (.Q (r_reg[3]), .C (clk_int), .CE (read_int), .D (
# Info: data_from_bus_int[3]), .R (nx198)) ;
# Info: FDRE \reg_r_reg(2) (.Q (r_reg[2]), .C (clk_int), .CE (read_int), .D (
# Info: data_from_bus_int[2]), .R (nx198)) ;
# Info: FDRE \reg_r_reg(1) (.Q (r_reg[1]), .C (clk_int), .CE (read_int), .D (
# Info: data_from_bus_int[1]), .R (nx198)) ;
# Info: FDRE \reg_r_reg(0) (.Q (r_reg[0]), .C (clk_int), .CE (read_int), .D (
# Info: data_from_bus_int[0]), .R (nx198)) ;
# Info: endmodule

Related

How to fix "RuntimeError: CUDA error: out of memory"

I have successfully trained in one GPU, but it cant work in multi GPU. I check the code but it just simple set some val in map, then carry out multi GPU training like torch.distributed.barrier.
I set the following code but failed even I set the batch size = 1.
docker exec -e NVIDIA_VISIBLE_DEVICES=0,1,2,3 -it jy /bin/bash
os.environ["CUDA_VISIBLE_DEVICES"] = '0,1,2,3'
The use of GPU.
|===============================+======================+======================|
| 0 GeForce RTX 208... On | 00000000:3D:00.0 Off | N/A |
| 24% 26C P8 21W / 250W | 8MiB / 11019MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 1 GeForce RTX 208... On | 00000000:3E:00.0 Off | N/A |
| 25% 27C P8 2W / 250W | 8MiB / 11019MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 2 GeForce RTX 208... On | 00000000:40:00.0 Off | N/A |
| 25% 25C P8 20W / 250W | 8MiB / 11019MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 3 GeForce RTX 208... On | 00000000:41:00.0 Off | N/A |
| 26% 25C P8 15W / 250W | 8MiB / 11019MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
The error informations.
/root/anaconda3/envs/pytorch171/lib/python3.7/site-packages/torch/distributed/launch.py:186: FutureWarning: The module torch.distributed.launch is deprecated
and will be removed in future. Use torchrun.
Note that --use_env is set by default in torchrun.
If your script expects `--local_rank` argument to be set, please
change it to read from `os.environ['LOCAL_RANK']` instead. See
https://pytorch.org/docs/stable/distributed.html#launch-utility for
further instructions
FutureWarning,
WARNING:torch.distributed.run:
*****************************************
Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
*****************************************
| distributed init (rank 2): env://
| distributed init (rank 1): env://
| distributed init (rank 3): env://
| distributed init (rank 0): env://
Traceback (most recent call last):
File "main_track.py", line 398, in <module>
main(args)
File "main_track.py", line 159, in main
utils.init_distributed_mode(args)
File "/jy/TransTrack/util/misc.py", line 459, in init_distributed_mode
torch.distributed.barrier()
File "/root/anaconda3/envs/pytorch171/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 2709, in barrier
work = default_pg.barrier(opts=opts)
RuntimeError: CUDA error: out of memory
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
WARNING:torch.distributed.elastic.multiprocessing.api:Sending process 355 closing signal SIGTERM
WARNING:torch.distributed.elastic.multiprocessing.api:Sending process 357 closing signal SIGTERM
WARNING:torch.distributed.elastic.multiprocessing.api:Sending process 358 closing signal SIGTERM
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 1 (pid: 356) of binary: /root/anaconda3/envs/pytorch171/bin/python3
Traceback (most recent call last):
File "/root/anaconda3/envs/pytorch171/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/root/anaconda3/envs/pytorch171/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/root/anaconda3/envs/pytorch171/lib/python3.7/site-packages/torch/distributed/launch.py", line 193, in <module>
main()
File "/root/anaconda3/envs/pytorch171/lib/python3.7/site-packages/torch/distributed/launch.py", line 189, in main
launch(args)
File "/root/anaconda3/envs/pytorch171/lib/python3.7/site-packages/torch/distributed/launch.py", line 174, in launch
run(args)
File "/root/anaconda3/envs/pytorch171/lib/python3.7/site-packages/torch/distributed/run.py", line 713, in run
)(*cmd_args)
File "/root/anaconda3/envs/pytorch171/lib/python3.7/site-packages/torch/distributed/launcher/api.py", line 131, in __call__
return launch_agent(self._config, self._entrypoint, list(args))
File "/root/anaconda3/envs/pytorch171/lib/python3.7/site-packages/torch/distributed/launcher/api.py", line 261, in launch_agent
failures=result.failures,
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
============================================================
main_track.py FAILED
------------------------------------------------------------
Failures:
<NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
time : 2022-10-13_08:54:25
host : 2f923a848f88
rank : 1 (local_rank: 1)
exitcode : 1 (pid: 356)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================

Facing issue in loading UART for Beaglebone debian

I am facing issue in loading uart port for Beaglebone Debian.
Following are my configurations:
I have a beaglebone with Debian OS. I have an sd card with 4 Partitions.
Partition 1 ( mmcblk0p1 ) contains following bootloader configurations:-
/boot/dtbs/4.14.71-ti-r80/am335x-bonegreen-wireless.dtb
/boot/vmlinuz-4.14.71-ti-r80
/boot/uEnv.txt
/boot/initrd.img-4.14.71-ti-r80
/lib/firmware/BB-UART4-00A0.dtbo
/lib/firmware/BB-UART1-00A0.dtbo
/lib/firmware/BB-I2C2-00A0.dtbo
/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
/lib/firmware/BB-BBGW-WL1835-00A0.dtbo
/lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo
/lib/firmware/BB-ADC-00A0.dtbo
/uEnv.txt
Partition 2 ( mmcblk0p2 ) contains the Debian OS.
Partition 3 ( mmcblk0p3 ) contains another Debian OS.
Partition 4 ( mmcblk0p4 ) decides from Which partition to boot?
/uEnv.txt from mmcblk0p1 reads from mmcblk0p4 and decides from which partition to boot.
This is my /uEnv.txt:
rdaddr=0x88080000
initrd_high=0xffffffff
fdt_high=0xffffffff
loadxrd=echo debug: [/boot/initrd.img-${uname_r}] ... ; load mmc 0:1 ${rdaddr} /boot/initrd.img-${uname_r}; setenv rdsize ${filesize}
loaduEnvtxt=load mmc 0:1 ${loadaddr} /boot/uEnv.txt ; env import -t ${loadaddr} ${filesize};
check_dtb=if test -n ${dtb}; then setenv fdtfile ${dtb};fi;
check_uboot_overlays=if test -n ${enable_uboot_overlays}; then setenv enable_uboot_overlays ;fi;
loadall=run loaduEnvtxt; run check_dtb; run check_uboot_overlays; run loadxrd;
rootpart=0:2
flagpart=0:4
bootdir=/boot
bootfile=vmlinuz-4.14.71-ti-r80
console=ttyO0,115200n8
fdtaddr=0x88000000
fdtfile=am335x-bonegreen-wireless.dtb
loadaddr=0x82000000
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait
mmcargs=setenv bootargs console=${console} ${optargs} ${cape_disable} ${cape_enable} root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}
loadfdt=echo debug: [/boot/dtbs/${uname_r}/${fdtfile}] ... ;load mmc 0:1 ${fdtaddr} /boot/dtbs/${uname_r}/${fdtfile}
loadimage=echo debug: [/boot/vmlinuz-${uname_r}] ... ; load mmc 0:1 ${loadaddr} /boot/vmlinuz-${uname_r}
boot_three=setenv rootpart 0:3; setenv mmcroot /dev/mmcblk0p3 ro
findroot=\
if test -e mmc $flagpart three; then \
if test -e mmc $flagpart three_ok; then \
run boot_three; \
elif test ! -e mmc $flagpart three_tried; then \
fatwrite mmc $flagpart $loadaddr three_tried 4; \
run boot_three; \
fi; \
elif test -e mmc $flagpart two; then \
if test ! -e mmc $flagpart two_ok; then \
if test -e mmc $flagpart two_tried; then \
run boot_three; \
else \
fatwrite mmc $flagpart $loadaddr two_tried 4; \
fi; \
fi; \
fi;
uenvcmd=\
run loadall; \
run findroot; \
echo Using root partition ${rootpart}; \
if run loadfdt; then \
echo Loaded ${fdtfile}; \
if run loadimage; then \
run mmcargs; \
bootz ${loadaddr} - ${fdtaddr}; \
fi; \
fi;
In /boot/uEnv.txt I have enabled following Configs:
uname_r=4.14.71-ti-r80
enable_uboot_overlays=1
uboot_overlay_addr0=/lib/firmware/BB-UART4-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/BB-UART1-00A0.dtbo
uboot_overlay_addr2=/lib/firmware/BB-I2C2-00A0.dtbo
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
enable_uboot_cape_universal=1
cmdline=coherent_pool=1M net.ifnames=0 quiet
My Boot logs:
U-Boot SPL 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500)
Trying to boot from MMC2
Loading Environment from EXT4...
** Unable to use mmc 0:1 for loading the env **
U-Boot 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500), Build: jenkins-github_Bootloader-Builder-65
CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4...
** Unable to use mmc 0:1 for loading the env **
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
Model: SeeedStudio BeagleBone Green Wireless:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net: eth0: MII MODE
Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] ...
board_rev=[GW1A] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
60067 bytes read in 6 ms (9.5 MiB/s)
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
2628 bytes read in 2 ms (1.3 MiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from /uEnv.txt
Importing environment from mmc ...
Checking if uenvcmd is set ...
gpio: pin 56 (gpio 56) value is 1
Running uenvcmd ...
2113 bytes read in 3 ms (687.5 KiB/s)
debug: [/boot/initrd.img-4.14.71-ti-r80] ...
4799493 bytes read in 303 ms (15.1 MiB/s)
Using root partition 0:2
debug: [/boot/dtbs/4.14.71-ti-r80/am335x-bonegreen-wireless.dtb] ...
60067 bytes read in 8 ms (7.2 MiB/s)
Loaded am335x-bonegreen-wireless.dtb
debug: [/boot/vmlinuz-4.14.71-ti-r80] ...
10416640 bytes read in 652 ms (15.2 MiB/s)
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Using Device Tree in place at 88000000, end 88011aa2
Starting kernel ...
[ 0.000749] timer_probe: no matching timers found
[ 0.783193] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 1.073624] omap_voltage_late_init: Voltage driver support not added
[ 1.080550] PM: Cannot get wkup_m3_ipc handle
Question:
Now when I boot into the partition and check for the UART port I am unable to find them.
ls -l /dev/ttyO*
lrwxrwxrwx 1 root root 5 Nov 3 2016 /dev/ttyO0 -> ttyS0
lrwxrwxrwx 1 root root 5 Nov 3 2016 /dev/ttyO2 -> ttyS2
The output I am expecting is:
lrwxrwxrwx 1 root root 5 Nov 3 2016 /dev/ttyO0 -> ttyS0
lrwxrwxrwx 1 root root 5 Nov 3 2016 /dev/ttyO1 -> ttyS1
lrwxrwxrwx 1 root root 5 Nov 3 2016 /dev/ttyO2 -> ttyS2
lrwxrwxrwx 1 root root 5 Nov 3 2016 /dev/ttyO3 -> ttyS3
lrwxrwxrwx 1 root root 5 Nov 3 2016 /dev/ttyO4 -> ttyS4
lrwxrwxrwx 1 root root 5 Nov 3 2016 /dev/ttyO5 -> ttyS5

Messages are getting struck in apache activemq master-slave configuration

I am facing problem of messages getting struck in activemq queue (with master slave configuration) and consumer is not able to consume messages when I pump around ~100 messages to different queues.
I have configured ActiveMQ (v5.9.0) message broker in two separate linux instances in master-slave mode. For persistenceAdapter conf on both the instances, I have mounted a NAS storage onto both the instances where activemq server is running. Hence same NAS storage is mounted on both activemq instances at mount point '/mnt/nas'. The size of the NAS storage is 20 GB.
So my persistenceAdapter conf looks like below
<persistenceAdapter>
<kahaDB directory="/mnt/nas" ignoreMissingJournalfiles="true" checkForCorruptJournalFiles="true" checksumJournalFiles="true"/>
</persistenceAdapter>
The systemUsage configuration on both activemq server is like below
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage percentOfJvmHeap = "70"/>
</memoryUsage>
<storeUsage>
<storeUsage limit = "15 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit = "7 gb"/>
</tempUsage>
</systemUsage>
</systemUsage>
and I have enabled only 'tcp' transport connector
<transportConnector name = "openwire" uri = "tcp://0.0.0.0:61616 maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
When I see the partition details of the mount point '/mnt/nas' on both activemq instances, I see following for the command df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda2 102953264 5840280 91883264 6% /
tmpfs 967652 0 967652 0% /dev/shm
/dev/xvda1 253871 52511 188253 22% /boot
//nas151.service.softlayer.com/IBM278684-16
139328579072 56369051136 82959527936 41% /mnt/nas
Hence I see 41% of /mnt/nas is used
The problem is when I start the activemq server (on both instances), I see the following messages in the activemq.log
**************** START ***************
2014-06-05 12:48:40,350 | INFO | PListStore:[/var/lib/apache-activemq-5.9.0/data/localhost/tmp_storage] started | org.apache.activemq.store.kahadb.plist.PListStoreImpl | main
2014-06-05 12:48:40,454 | INFO | JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi | org.apache.activemq.broker.jmx.ManagementContext | JMX connector
2014-06-05 12:48:40,457 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/mnt/nas] | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:40,612 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 8163..8209 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,613 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 12256..12327 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,649 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 20420..20585 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,650 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 28559..28749 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,651 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 32677..32842 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,652 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 36770..36960 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,655 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 49099..49264 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,657 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 61403..61474 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,658 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 65521..65567 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,659 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 69614..69685 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:40,660 | INFO | Corrupt journal records found in '/mnt/nas/db-1.log' between offsets: 77778..77824 | org.apache.activemq.store.kahadb.disk.journal.Journal | main
2014-06-05 12:48:41,543 | INFO | KahaDB is version 5 | org.apache.activemq.store.kahadb.MessageDatabase | main
2014-06-05 12:48:41,592 | INFO | Recovering from the journal ... | org.apache.activemq.store.kahadb.MessageDatabase | main
2014-06-05 12:48:41,604 | INFO | Recovery replayed 66 operations from the journal in 0.028 seconds. | org.apache.activemq.store.kahadb.MessageDatabase | main
2014-06-05 12:48:41,772 | INFO | Apache ActiveMQ 5.9.0 (localhost, ID:10.106.99.101-60576-1401972521638-0:1) is starting | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:41,892 | INFO | Listening for connections at: tcp://10.106.99.101:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 | org.apache.activemq.transport.TransportServerThreadSupport | main
2014-06-05 12:48:41,893 | INFO | Connector openwire started | org.apache.activemq.broker.TransportConnector | main
2014-06-05 12:48:41,893 | INFO | Apache ActiveMQ 5.9.0 (localhost, ID:10.106.99.101-60576-1401972521638-0:1) started | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:41,893 | INFO | For help or more information please see: http://activemq.apache.org | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:41,897 | WARN | Store limit is 2048 mb, whilst the data directory: /mnt/nas only has 0 mb of usable space - resetting to maximum available disk space: 0 mb | org.apache.activemq.broker.BrokerService | main
2014-06-05 12:48:41,897 | ERROR | Store limit is 0 mb, whilst the max journal file size for the store is: 32 mb, the store will not accept any data when used. | org.apache.activemq.broker.BrokerService | main
******************** END **************
I see 'Corrupt journal records found in '/mnt/nas/db-1.log'. This comes for everytime restart even though if I delete this file and restart.
I had put the flag to recover but still this log entry comes for every restart.
Another problem is, even though my NAS storage is 20GB, it shows '/mnt/nas only has 0 mb of usable space'. This is really weird. I am not sure why 0 MB is available to activemq
I request people here to give me some suggestions on why it is happening like this and suggest me any better configurations to avoid messages getting struck in queue.
Thanks
Raagu

perf can find symbol in the kernel ,but can not find symbol in my program. How to fix it?

you may have read this question:
how can i get perf to find symbols in my program
1)my question is:
when I use perf report , it gives a result like this:
# Overhead Command Shared Object Symbol
# . .
#
99.59% test test [.] 0x000003d4
0.21% test [kernel.kallsyms] [k] __do_fault
0.10% test [kernel.kallsyms] [k] run_timer_softirq
0.10% test [kernel.kallsyms] [k] __update_cpu_load
0.01% test [kernel.kallsyms] [k] set_task_comm
0.00% test [kernel.kallsyms] [k] intel_pmu_enable_all
That is: the perf can find symbol in kernel but cannot find symbol in my program.
my program is here:
void longa()
{
int i,j;
for(i = 0; i < 1000000; i++)
j=i; //am I silly or crazy? I feel boring and desperate.
}
void foo2()
{
int i;
for(i=0 ; i < 10; i++)
longa();
}
void foo1()
{
int i;
for(i = 0; i< 100; i++)
longa();
}
int main(void)
{
foo1();
foo2();
}
2)I have compile the program like:
gcc test.c -g -o test
My env: os:ubuntu kernel:3.10.9
Today, when I run perf test, I got a message saying vmlinux symtab matches kallsyms: Failed.
When I was looking for the reason, I found that the reason is that the value of /proc/sys/kernel/kptr_restrict is 1. When we set it to 0, we will get the symbol in our program.
There are 2 possible sources of the problem:
Your perf tool was compiled without elfutils support.
Your perf tool cannot find libelf.so library on your target.
I ran into the same problem, and found out the reason is that the dwarf feature of my perf was not turned on.
A simple solution is to recompile perf:
% sudo apt-get install libdw-dev
% cd /path/to/perf/source/
% sudo make
% sudo make install
This enables perf to find all symbols!
If it still do not work for you, please refer to this link,
how to compile a Linux perf tool with all features.
Huh, i just tried this and to me it works as it should, afaik. Enviroment is ubuntu 13.04 (with gcc 4.7.3).
If it still does not work for you, you might want to check out that the debug symbols are otherwise fine, with say gdb.
% gcc test.c -g -o test
XXX#YYY
% perf record ./test
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.060 MB perf.data (~2620 samples) ]
XXX#YYY
% perf report --stdio
# ========
# captured on: Wed Oct 16 11:58:40 2013
# hostname : sundberg-office-antec
# os release : 3.8.0-31-generic
# perf version : 3.8.13.8
# arch : x86_64
# nrcpus online : 2
# nrcpus avail : 2
# cpudesc : AMD Phenom(tm) II X2 555 Processor
# cpuid : AuthenticAMD,16,4,3
# total memory : 16434276 kB
# cmdline : /usr/bin/perf_3.8.0-31 record ./test
# event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0, id = { 671, 672 }
# HEADER_CPU_TOPOLOGY info available, use -I to display
# HEADER_NUMA_TOPOLOGY info available, use -I to display
# pmu mappings: cpu = 4, software = 1, tracepoint = 2, ibs_fetch = 6, ibs_op = 7, breakpoint = 5
# ========
#
# Samples: 1K of event 'cycles'
# Event count (approx.): 1071717616
#
# Overhead Command Shared Object Symbol
# ........ ....... ................. .........................
#
99.85% test test [.] longa
0.08% test [kernel.kallsyms] [k] call_timer_fn
0.08% test [kernel.kallsyms] [k] task_work_run
0.00% test [kernel.kallsyms] [k] clear_page_c
0.00% test [kernel.kallsyms] [k] native_write_msr_safe
#
# (For a higher level overview, try: perf report --sort comm,dso)
#

IPMItool sel command on PER610 does not provide detailed information

ipmitool sel elist
on R610 output:
1 | 08/01/2011 | 23:18:11 | Event Logging Disabled SEL | Log area reset/cleared | Asserted
2 | Pre-Init Time-stamp | Physical Security Intrusion | General Chassis intrusion | Asserted
3 | Pre-Init Time-stamp | Physical Security Intrusion | General Chassis intrusion | Deasserted
4 | 01/31/2012 | 11:32:50 | Temperature #0x30 | Upper Critical going high
on R810 its:
Severity : Normal
Date and Time : System Boot
Description : The chassis is closed while the power is On.
Event Data : 0x80 0x02 0xff
I am concern about severity of message. I am developing a code which will send an email if the message is critical. But in the case of R610 there is no way to found severity of message.
If you're trying to read the actual data from the SEL then you need to use the ipmitool sel get command and not the ipmitool sel elist command.
the ipmitool sel get command returns the detailed breakdown of the information in the event log for the item in question.
e.g. from one of my own systems:
machine:/ # ipmitool sel get 0x2c
SEL Record ID : 002c
Record Type : 02
Timestamp : 02/13/2012 17:49:21
Generator ID : 0021
EvM Revision : 04
Sensor Type : Voltage
Sensor Number : 60
Event Type : Threshold
Event Direction : Assertion Event
Event Data : 02ffff
Description : Lower Critical going low

Resources