Strings in Verilog — www.dilloneng.com
-
Strings in Verilog
A quick reference on a couple of ways to manipulate strings in Verilog HDL.
Declaration
There is no string data type is Verilog, so use the following to declare a register to hold a string.
reg[n*8:0] string;
Where the maximum length of the string is n characters. It takes 8 bits to store each character.
Usage
string = "Hello World";
$sdisplay("%s", string); // will get "Hello World"Also, normal concatination will work, for the most part. So something like:
string = {"/path/to/file","/","filename",".txt"};
will result in a string useful to pass to $open to open a file.
For anything more advanced, a very good function is
$sformat(string,"%s %d %s",str1,num,str2);
would produce the string with the three varibles concatinated together and spaces in between.
Top Tags
Sponsored Links
View All Recent Tags (49)
- 12Apache,
- 9openssl,
- 8linux,
- 8rpm,
- 7Perl,
- 7ssl,
- 6打包,
- 6rpm-build,
- 6pcap,
- 5抓包,
- 4elf,
- 4bio,
- 4文件,
- 4日志,
- 3加密,
- 3Encrypt,
- 3burneye,
- 3性能,
- 3ssh,
- 3程序,
- 3制作,
- 3BIO_do_accept,
- 3监控,
- 3目录,
- 3http,
- 3log,
- 3日志分析,
- 3module,
- 3限制,
- 3模块,
- 2diff,
- 2arp,
- 2arpspoof,
- 2arpalert,
- 2Shiva,
- 2效率,
- 2IP,
- 2sqlite,
- 2proxy,
- 2Windows,
- 2命令行,
- 2工具,
- 2CA,
- 2建置,
- 2证书,
- 2优化,
- 2Host,
- 2MIB,
- 2source
Public Tags (1138)
- 1Untagged Bookmarks
- 1-f,
- 1-fPIC,
- 1-nostdlib,
- 1.htaccess,
- 11,
- 31.3,
- 11983,
- 22.0,
- 22.6,
- 12006,
- 12008,
- 12g,
- 12gb,
- 14,
- 150,
- 150个,
- 1624,
- 16月13,
- 1745,
- 17月22,
- 19,
- 1a.vim,
- 1accept,
- 1Access,
- 1acl,
- 1aclocal,
- 1activeperl,
- 1Admin,
- 1Administrator,
- 1all,
- 38Apache,
- 3apache2,
- 1apacheformat,
- 10API,
- 2APNIC,
- 1application,
- 1APR,
- 3arp,
- 2arpalert,
- 2arpspoof,
- 1asia,
- 1asprintf,
- 1Assembly,
- 1auto,
- 3Autoconf,
- 1autoheader,
- 3automake,
- 1autoscan,
- 1autotools,
- 1average,
- 2awk,
- 3bandwidth,
- 1bash,
- 2bash-completion,
- 1bash_completion,
- 1bbs,
- 1bho,
- 1binary,
- 19bind,
- 10bind9,
- 4bio,
- 1bios,
- 3BIO_do_accept,
- 13bison,
- 1BitTorrent,
- 2BNBT,
- 1books,
- 1boost,
- 1booting,
- 8bt,
- 1buffer,
- 3burneye,
- 1bw_mod,
- 26C,
- 8c++,
- 1c.vim,
- 2c89,
- 4C99,
- 3CA,
- 1cache_peer,
- 1calloc,
- 1cast,
- 1cd,
- 5cdn,
- 2ceil,
- 1centos,
- 1centre,
- 1Cerberus,
- 1Change,
- 1chdir,
- 1CheckInstall,
- 1cherry,
- 1China,
- 1chm,
- 1chroot,
- 1class,
- 1client,
- 1ClientAliveInterval,
- 1close,
- 1cmds_allowed,
- 1Code,
- 1column,
- 1columns,
- 1combin,
- 1combine,
- 5Config,
- 1configfile,
- 2configuration,
- 1conf_parser,
- 1connect,
- 1connection,
- 1console,
- 1Converting,
- 1copy,
- 1copy mmap,
- 1courier,
- 4cpan,
- 1cpp,
- 3cpu,
- 1cpuid,
- 1cpuinfo,
- 1create,
- 1cronolog,
- 1cscope,
- 1css,
- 2ctags,
- 1Cuil,
- 2curl,
- 3curses,
- 1cygwin,
- 1c 面试,
- 4C语言,
- 1c语言版,
- 9d,
- 2daemon,
- 1database,
- 2deb,
- 1deb-src,
- 1debug,
- 1deny_file,
- 1dhtml,
- 1Dialog,
- 2diff,
- 1directories,
- 1directory,
- 1DisplayName,
- 1distinct,
- 1dlclose,
- 1dlerror,
- 1dlopen,
- 1dlsym,
- 1dma,
- 2dnotify,
- 12dns,
- 6doc,
- 2Document,
- 3Documentation,
- 1dom,
- 1DProf,
- 1dsource,
- 1dump,
- 1Dynamic,
- 1e1000,
- 4elf,
- 1email,
- 1Embed,
- 2Embedding,
- 3Encrypt,
- 1english,
- 2eof,
- 1epoll,
- 1eres,
- 1esc,
- 1esc控制字符,
- 1ESMTP,
- 1ET,
- 1eth,
- 1ethtool,
- 1eval,
- 2excel,
- 1excel 成绩,
- 1Exchange,
- 2exec,
- 1execl,
- 1execl 技巧,
- 1Executables,
- 1expect,
- 1expressions,
- 1Extend,
- 1Extending,
- 2extmail,
- 2extman,
- 1fam,
- 6faq,
- 1fcntl,
- 1fedora,
- 2fflush,
- 1fgetc,
- 3file,
- 1fileencodings,
- 3files,
- 1filesmatch,
- 2filter,
- 1find,
- 1firefox,
- 10flex,
- 2float,
- 2floor,
- 1font-unix,
- 1fopen,
- 2Format,
- 1Forum,
- 2fPIC,
- 1fprintf,
- 1FPU,
- 1from,
- 1fstatfs,
- 1fsync,
- 1ftp,
- 1Function,
- 1Functions,
- 1F_NOTIFY,
- 1gaim.pc,
- 1gb2312,
- 5gcc,
- 2gd,
- 4gdb,
- 2Generator,
- 1get,
- 1getch,
- 1getchar,
- 1getopt,
- 1getopt_long,
- 1git,
- 5glib,
- 2glibc,
- 5GNU,
- 1gnu99,
- 1gnugpg,
- 1Gnulib,
- 1google,
- 2gpg,
- 1gpl,
- 2gprof,
- 2graceful,
- 2grant,
- 1gui,
- 1guide,
- 1hanoi,
- 1hdl,
- 1Helpdesk,
- 1Hierarchy,
- 4Host,
- 1HOST-RESOURCES-MIB,
- 1howto,
- 1hta,
- 2htaccess,
- 1html,
- 7http,
- 3httpd,
- 1httpd.conf,
- 2HUP,
- 1ibpcap,
- 1IC,
- 1Identifier,
- 2ie,
- 2IEEE,
- 1ifDocuments,
- 1ifInOctets,
- 1ifOutOctets,
- 1ifRequests,
- 1Index,
- 1information,
- 2ini,
- 1init,
- 2inotify,
- 1Internals,
- 1internet explorer,
- 1Interpreter,
- 1ioctl,
- 5IP,
- 2IPC,
- 1IP库,
- 1IT论文,
- 1john,
- 2jpg,
- 1kbhit,
- 1kernel,
- 1key,
- 9language,
- 1ldconfig,
- 2LEMON,
- 10lex,
- 4lib,
- 2libbt,
- 2libcurl,
- 1libcurses,
- 1libESMTP,
- 2LibGD,
- 1libgtop,
- 1libncurses,
- 7libnet,
- 8libpcap,
- 2Libraries,
- 6Library,
- 1libssh2,
- 2libssl,
- 1libsvn_ra_dav,
- 1libtop,
- 2libtorrent,
- 3libxml,
- 2libxml2,
- 1lighttpd,
- 48linux,
- 1linuxthreads,
- 1List,
- 1Load,
- 1local,
- 4log,
- 1logroatate,
- 1loop,
- 1losetup,
- 1lprintf,
- 1lrc,
- 1LT,
- 1lwp,
- 1mac,
- 1macro,
- 2macros,
- 2mail,
- 1mailbox,
- 3maildrop,
- 1maillist,
- 1mailserver,
- 2main,
- 1main.cf,
- 2Makefile,
- 2malloc,
- 2man,
- 2Manual,
- 1map,
- 1Mapper,
- 1mapping,
- 1math,
- 2meminfo,
- 2mfc,
- 2MIB,
- 1mibs,
- 1mingw,
- 2mmap,
- 1Modify,
- 6module,
- 1Modules,
- 2mod_bandwidth,
- 1mod_bwshare,
- 2mod_cband,
- 1mod_extract_forwarded,
- 1mod_limitipconn,
- 1mod_myvhost,
- 1mod_my_pointer,
- 1mod_pointer,
- 2mod_rewrite,
- 1mod_throttle,
- 2mod_vhost_alias,
- 1mod_vhost_limit,
- 1mod_watch,
- 1mount,
- 1mozdev,
- 1mp3,
- 1MPM,
- 1msdn,
- 2msxml,
- 2munmap,
- 1Mutex,
- 1mvc,
- 13mysql,
- 1mysql4,
- 1mysql5,
- 2mysqladmin,
- 1mysqldump,
- 1mysql_options,
- 1mysql_opt_reconnect,
- 1mysql_ping,
- 1named,
- 3named.conf,
- 1namespace,
- 3napi,
- 1nat,
- 1ncurses,
- 1nessus,
- 5Net-snmp,
- 2netsnmp,
- 1network,
- 1new,
- 1nMaster,
- 2nocc,
- 1nod32,
- 1nohup,
- 1nostdlib,
- 1notes,
- 1notification,
- 13no_tag,
- 1no_tag,
- 1nptl,
- 1nsupdate,
- 1ntop,
- 1null,
- 1on,
- 1openq,
- 1OpenSolaris,
- 12openssl,
- 1Operating,
- 1os,
- 6p2p,
- 1pacific,
- 1package,
- 2Packet,
- 1PAI,
- 1paketto,
- 1pam-mysql,
- 1paratrace,
- 1Parse,
- 4Parser,
- 1parsing,
- 1patching,
- 10pcap,
- 1pdf,
- 1pedantic,
- 18Perl,
- 1permissions,
- 1persistent,
- 3pf_ring,
- 1ph,
- 1PhotoShop,
- 1PHP,
- 1phpmyadmin,
- 1PIC,
- 1plink,
- 2plugin,
- 2png,
- 1pool,
- 1pooling,
- 2posix,
- 1post,
- 10postfix,
- 1postfixadmin,
- 1postgresql 导入 导出,
- 1ppm,
- 1primary,
- 2printf,
- 5proc,
- 1process,
- 1Profile,
- 1Profiling,
- 1proftp,
- 5proftpd,
- 3program,
- 3proxy,
- 2ps,
- 2putty,
- 1pypi,
- 6python,
- 1QQ,
- 1qsort,
- 1queryperf,
- 1quick,
- 1quick-sort,
- 4quota,
- 1quotalimits,
- 1rand,
- 1raw,
- 1rdf,
- 1re-entrant,
- 1React,
- 1ReactOS,
- 2read,
- 1readhat,
- 1readline,
- 1reboot,
- 1recipients,
- 1recv,
- 1redhat,
- 1reentrant,
- 5Reference,
- 3regex,
- 1regular,
- 1rejecting,
- 1relay,
- 4reload,
- 1rescue,
- 1resources,
- 1Review,
- 2rfc,
- 1RHEL,
- 1ripe-dbase-client-v3,
- 1ripper,
- 1RIR,
- 1rndc,
- 2root,
- 1rotatelogs,
- 1route,
- 1router,
- 1rpcgen 分布式,
- 13rpm,
- 8rpm-build,
- 1rpmlint,
- 1rTorrent,
- 1safe,
- 1sasl,
- 1scanf,
- 1scp,
- 2search,
- 1secureCRT,
- 1seed,
- 2select,
- 1Semaphore,
- 1send,
- 1serialize,
- 1session,
- 1setbuf,
- 1setsid,
- 1sformat,
- 5shell,
- 2Shiva,
- 1shmat,
- 1shmget,
- 2shutdown,
- 1sigbus,
- 2sighup,
- 1sigkill,
- 1signal,
- 1SIGTERM,
- 1simlpe,
- 1siocgifaddr,
- 1siocgifconf,
- 1siocgifflags,
- 1siocgifhwaddr,
- 3smtp,
- 4snmp,
- 1snmp.conf,
- 1snmpd.conf,
- 2snprintf,
- 2so,
- 5socket,
- 1socket 阻塞 非阻塞 write,
- 1SOCK_RAW,
- 1Solaris,
- 2sort,
- 3source,
- 1sprintf,
- 2sql,
- 5sqlite,
- 1sqlite2,
- 3sqlite3,
- 1sqlite3_exec,
- 1sqlrelay,
- 9squid,
- 1srand,
- 1sscanf,
- 6ssh,
- 1ssh2,
- 10ssl,
- 1start,
- 1startx,
- 2stat,
- 1statfs,
- 1static,
- 1Statistics,
- 1stdin,
- 1strace,
- 1strcasestr,
- 1string,
- 2stripcc,
- 1stristr,
- 1strstr,
- 1structure,
- 1su,
- 3sudo,
- 1svn,
- 1svn_ra_dav__init,
- 1SVtags,
- 1swap,
- 1switch,
- 1sync,
- 2System,
- 2Tags,
- 1tail,
- 1tar.bz2.sig,
- 3TCP,
- 1tcpdump,
- 1TCP_IP,
- 1tdelete,
- 1tdestroy,
- 1tfind,
- 1the,
- 1thismail,
- 1thread,
- 1thread-safe,
- 1threads,
- 1throttling,
- 1to,
- 1top,
- 2torrent,
- 1traceroute,
- 1tracert,
- 1Tracker,
- 3tree,
- 1trie,
- 1tsearch,
- 1tunnel,
- 1tutorial,
- 1twalk,
- 1twinst,
- 1type,
- 2ubuntu,
- 1umask,
- 2UML,
- 1undefined,
- 1Uninstall,
- 1union,
- 2Unique,
- 1Universal,
- 1unix,
- 1unix_:7100,
- 1unix 体验中心,
- 1unknown,
- 1unlink,
- 1unserialize,
- 1unzip,
- 1UPX,
- 1url-list,
- 2USR1,
- 1usr_toc,
- 1utf8,
- 1UUID,
- 1v,
- 1VACUUM,
- 3valgrind,
- 1variadic,
- 1vasprintf,
- 1vb,
- 3vba,
- 7vbs,
- 7vbscript,
- 8vc,
- 1vc6,
- 1vc7,
- 1vc 技巧,
- 1vc 编程,
- 1verilog,
- 1version,
- 1vfprintf,
- 1vhcs,
- 1vhcs2,
- 6vi,
- 11vim,
- 1vimperator,
- 3virtual,
- 1vmnet,
- 1vmnet0,
- 1vmnet8,
- 1vmware,
- 1void,
- 1vprintf,
- 3vsftp,
- 4vsftpd,
- 1vsftpd.conf,
- 1vsnprintf,
- 1vsprintf,
- 1warning,
- 1web,
- 2webmail,
- 1WebTrack,
- 2whois,
- 1win32,
- 6Windows,
- 1windows 消息 mfc,
- 1windows 消息 重定向,
- 1wtl,
- 1xbaydns,
- 1xfs,
- 6xml,
- 1XML::Simple,
- 1xmlCleanupParser,
- 1xmlInitParser,
- 1xmms,
- 1xmms-mpg123-ja,
- 1xp,
- 1xpath,
- 12yacc,
- 1zero,
- 1zero-copy,
- 2zip,
- 1zlib,
- 6zone,
- 3zonefile,
- 1_dev_zero,
- 1_proc_stat,
- 1_start,
- 1|,
- 1 正则,
- 1一行,
- 1一行程序,
- 1上下文切换,
- 1上下文无关,
- 1上半年,
- 1下拉菜单,
- 1不完整,
- 1个性,
- 1中国,
- 5中文,
- 1主板,
- 2乱码,
- 2事件,
- 1事件日志,
- 1事件查看器,
- 1事务,
- 1二叉树,
- 1互斥,
- 1交换机,
- 1人体,
- 2代理,
- 3优化,
- 2会话,
- 1伪造,
- 1伪静态,
- 1位置无关,
- 1体系结构,
- 1使用手册,
- 1使用率,
- 1使用详解,
- 1保存,
- 1信号,
- 1信号量,
- 1元新,
- 1元新科技,
- 2入门,
- 3共享内存,
- 2共享库,
- 1共存,
- 1关闭,
- 8内存,
- 1内存池,
- 3内存泄漏,
- 1内存管理,
- 1内核,
- 1内核空间 切换,
- 1农历,
- 1冲突,
- 3函数,
- 2函数库,
- 1函数族,
- 1函数调用,
- 2分支,
- 5分析,
- 1分析工具,
- 1分配,
- 1列,
- 1删除,
- 1利用率,
- 3制作,
- 1刷新,
- 4加密,
- 1加速,
- 3动态,
- 3动态库,
- 1动态规划,
- 1动态解析 ip,
- 2动态配置,
- 1包,
- 1包头,
- 1区别,
- 1升级,
- 4协议,
- 1协议分析,
- 1卓越之道,
- 1博客 推广 站点收集,
- 1占用率,
- 1原始,
- 1原始套接口,
- 3参数,
- 2参考,
- 2参考手册,
- 1双截棍,
- 1反向 反向代理,
- 1反向代理,
- 1反序列化,
- 1反调试,
- 1发呆,
- 1变化,
- 1变长数组,
- 1可变,
- 1可变参数宏,
- 1可执行,
- 2可移植,
- 2可重入,
- 1合并,
- 1名字空间,
- 1后台,
- 1后缀,
- 1后缀名,
- 1启动,
- 1命令,
- 1命令参数,
- 3命令行,
- 1命令行参数,
- 1命名空间,
- 1响应时间,
- 1唯一,
- 2图形库,
- 1图形界面,
- 1图灵,
- 1图片,
- 1地址,
- 1地址分配库,
- 1地址库,
- 1域名,
- 1域文件,
- 1基于主机名,
- 1基于名字,
- 1增强,
- 2备份,
- 1多线程,
- 1多进程,
- 1大作战,
- 1大全,
- 2大批量,
- 1大文件,
- 1套接口,
- 2字符串,
- 1存储格式,
- 1学习笔记,
- 2守护进程,
- 2安全,
- 4安装,
- 1安装路径,
- 1安装软件,
- 2宏,
- 1定义,
- 2实例,
- 2实时,
- 1实现,
- 1实际,
- 1家园,
- 1家驹,
- 1密匙,
- 3密码,
- 1密码 忘记,
- 2导入,
- 2导出,
- 1小技巧,
- 1小林,
- 1小结,
- 1嵌入,
- 1嵌入式,
- 3工具,
- 2带宽,
- 1常用,
- 1常见误区,
- 2常见问题,
- 1常见问题集,
- 1平均负载,
- 1并发数,
- 1序列化,
- 1序列号,
- 6库,
- 1库函数,
- 2建置,
- 1开发,
- 2异常,
- 1强制转换,
- 1心跳包,
- 2快速排序,
- 5性能,
- 2性能分析,
- 2总结,
- 1恢复,
- 3手册,
- 8打包,
- 1打包 rpm-build,
- 1打开,
- 1扩展,
- 3技巧,
- 1技术内幕,
- 9抓包,
- 1拖动,
- 1括号,
- 1指令,
- 1指南,
- 2排序,
- 1控制字符,
- 3控制终端,
- 1控制终端代码,
- 2插件,
- 2搜索,
- 2搜索引擎,
- 1操作系统性,
- 1改密码,
- 1攻略,
- 3效率,
- 1效率 开发,
- 4教程,
- 1数字,
- 1数字设计,
- 1数字逻辑,
- 1数据包,
- 3数据库,
- 1数据段,
- 1整个包,
- 7文件,
- 2文件名,
- 2文件系统,
- 4文档,
- 1文法,
- 1断线,
- 7日志,
- 3日志分析,
- 1时间倒流 光速 爱因斯坦,
- 1更改,
- 1更新,
- 1曾超,
- 3替换,
- 4服务器,
- 1未定义,
- 1机制,
- 2权限,
- 2条件编译,
- 1构造,
- 1构造函数,
- 1林建森 个人空间,
- 1林旺荗,
- 1查询,
- 1标准,
- 1标准化,
- 1树,
- 2格式,
- 2格式化输出函数,
- 1检测,
- 8模块,
- 1模型,
- 1模式,
- 1模拟,
- 1樱桃,
- 7正则,
- 3正则表达式,
- 1正则表达式 awk,
- 1永久,
- 1汇总,
- 1汉诺塔,
- 1池,
- 1没有,
- 3泄漏,
- 1注册表,
- 1注释,
- 1注销,
- 3流量,
- 1测试工具,
- 2浮点数,
- 2消息,
- 1消息映射,
- 1消息队列,
- 1深入理解计算机,
- 2添加,
- 1游戏,
- 1源,
- 3源代码,
- 3源码,
- 1版本,
- 1版本管理,
- 1状态,
- 1状态代码,
- 1状态码,
- 1环境,
- 1生日,
- 3用户,
- 1用户空间,
- 1电信,
- 1电子,
- 2电子书,
- 1电路,
- 1界面,
- 1的返回值,
- 5监控,
- 1监测,
- 6目录,
- 1真实,
- 1破解,
- 1硬盘,
- 1磁盘,
- 1磁盘配额,
- 1磁盘限额,
- 1社区,
- 2移植,
- 3程序,
- 1程序性能,
- 1空间,
- 2端口转发,
- 2笔记,
- 1第一卷,
- 1签名,
- 1简介,
- 1算法,
- 1管道,
- 1篱笆网,
- 1系分,
- 2系统分析,
- 2系统分析员,
- 3系统分析师,
- 1系统平均负载,
- 1系统性能,
- 1系统运行信息,
- 1红黑树,
- 1纯真,
- 2线程,
- 2线程安全,
- 1线程模型,
- 1组装,
- 2终端,
- 1经典,
- 1经济危机,
- 1结合,
- 1继承,
- 1缓冲,
- 1缓冲区,
- 2编码,
- 6编程,
- 3编译,
- 1编译原理,
- 1网关,
- 1网卡,
- 1网站,
- 1网站加速,
- 1网络 虚拟网络 vmnet,
- 1网络管理系统,
- 1网通,
- 1罗纳尔多,
- 1群,
- 1联盟,
- 5脚本,
- 1脱离,
- 2自动,
- 2自动补全,
- 1自动补齐,
- 1自动识别,
- 1自动输入,
- 1自动重连,
- 1英文,
- 1英语,
- 1获取,
- 5虚拟主机,
- 1蚂蚁,
- 1行号,
- 1补全,
- 1解压,
- 1解析,
- 1解答,
- 1解释器,
- 1警告,
- 1计算器,
- 1计算机应用,
- 1记录,
- 1论文,
- 1设置,
- 3证书,
- 1词法分析,
- 1详解,
- 1语法,
- 9语言,
- 1读,
- 3调用,
- 3调试,
- 1负载,
- 1超时,
- 1路径,
- 1路由,
- 1身份验证,
- 2转发,
- 1转换,
- 2软件,
- 1软件工程,
- 1软件考试,
- 2软考,
- 1输入,
- 1过时,
- 1运行机制,
- 2返回值,
- 1返回码,
- 2进程,
- 1进程信息,
- 1进程关系,
- 1进程数,
- 2进程组,
- 1进程间通信,
- 1连接,
- 2连接数,
- 1连接池,
- 1选项,
- 1透视,
- 1透视图,
- 1递归,
- 1通信,
- 1通信人,
- 1通知,
- 2速度,
- 1逻辑,
- 1邮件,
- 1邮件服务器,
- 4配置,
- 1配置 变化 http_port,
- 3配置文件,
- 1重入,
- 1重启,
- 1重定向,
- 2重组,
- 1铁通,
- 1错误处理,
- 1键盘,
- 1镜像,
- 1长连接,
- 1问题集,
- 1防盗链,
- 1附件,
- 1陈先通,
- 8限制,
- 1限制目录,
- 1限速,
- 1隐患,
- 1零拷贝,
- 1零拷贝 zero,
- 1静态,
- 2静态库,
- 2非阻塞,
- 1面向对象,
- 1顺序,
- 2预编译,
- 1验证,
- 1高并发,
- 1黄家驹 beyond
yecheng 's Public Lists (1)
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo