如何绘制时钟周期数到上升沿?

如何绘制时钟周期数到上升沿?

我想在上升沿显示每个时钟周期的数字。我尝试设置一个计数器,但它给出了以下错误:

Package pgfkeys Error: I do not know the key '/tikz/timing/counter/new', to wnd I am going to ignore it. Perhaps you misspelled it. ... ,text style={font=\scriptsize}}] 18{c} \\$

这里是代码:

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-timing}
\usepackage{pgf-umlsd}
\usepackage{pgf}

\usepgflibrary{arrows} % for pgf-umlsd

\begin{document}
\begin{tikztimingtable}[
    timing/dslope=0.1,
    timing/.style={x=7ex,y=2ex},
    x=5ex,
    timing/rowdist=3ex,
    timing/name/.style={font=\sffamily\scriptsize},
]
    CLK       &  [timing/counter/new={char=c,max value=15, wraps ,text style={font=\scriptsize}}] 18{c} \\
    GNT       & L N(A1) 8H \\
    FRAME     & U 6L H U \\
    AD   & 2u 1D{Adresse} 1U{} 1D{$d_1$} D{$d_1 '$} D{$d_2$} 2D{$d_3$} U \\
    C/BE & 2u 1D{0010} 6D{BE\#} U  \\
    IRDY       & UU 4L HLH \\
    TRDY       & UU HLH 3L H \\
    DEVSEL     & 2U 6L H\\
\end{tikztimingtable}

\end{document}

答案1

查看文档,timing/counter/new由库提供counters。因此您需要加载该库:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz-timing}
\usetikztiminglibrary{counters}
\begin{document}
  \begin{tikztimingtable}[
    timing/dslope=0.1,
    timing/.style={x=7ex,y=2ex},
    x=5ex,
    timing/rowdist=3ex,
    timing/name/.style={font=\sffamily\scriptsize},
    ]
    CLK       & [timing/counter/new={char=c,max value=15, wraps ,text style={font=\scriptsize}}] 18{c} \\
    GNT       & L N(A1) 8H \\
    FRAME     & U 6L H U \\
    AD   & 2u 1D{Adresse} 1U{} 1D{$d_1$} D{$d_1 '$} D{$d_2$} 2D{$d_3$} U \\
    C/BE & 2u 1D{0010} 6D{BE\#} U  \\
    IRDY       & UU 4L HLH \\
    TRDY       & UU HLH 3L H \\
    DEVSEL     & 2U 6L H\\
  \end{tikztimingtable}
\end{document}

新的计时计数器

相关内容